/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* easyfind.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/09/19 08:06:39 by narnaud #+# #+# */ /* Updated: 2022/09/19 08:06:42 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include #include #include #include template typename T::iterator easyfind(T &t, const int nb) { typename T::iterator it; it = find(t.begin(), t.end(), nb); if (it == t.end()) return (t.end()); return (it); } template void is_easyfound(T it, T end) { if (it != end) std::cout << "You found: " << *it << std::endl; else std::cout << "You didn't found it." << std::endl; }