#ifndef EASYFIND_HPP # define EASYFIND_HPP # include "colors.h" # include class easyfindException : public std::exception { virtual char const *what(void) const throw() { return "not found"; } }; template < typename T > typename T::const_iterator easyfind(T const & container, int nb) { typename T::const_iterator it; it = std::find(container.begin(), container.end(), nb); if (it == container.end()) throw easyfindException(); return it; } #endif