Files
cpp08/ex00/easyfind.hpp
Angel Ortigosa Perez 39b7ee24e2 minimal fixes
2026-04-21 21:55:24 +02:00

29 lines
1.2 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* easyfind.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/04/17 20:26:54 by aortigos #+# #+# */
/* Updated: 2026/04/21 21:49:31 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include <iostream>
#include <vector>
template <typename T>
typename T::iterator easyfind(T &array, int nb)
{
for(typename T::iterator it = array.begin();
it != array.end();
it++)
{
if (*it == nb)
{
return (it);
}
}
throw std::exception();
}