diff options
Diffstat (limited to 'cpp08/ex00/easyfind.hpp')
| -rw-r--r-- | cpp08/ex00/easyfind.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp08/ex00/easyfind.hpp b/cpp08/ex00/easyfind.hpp new file mode 100644 index 0000000..68e176c --- /dev/null +++ b/cpp08/ex00/easyfind.hpp @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* easyfind.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/15 05:53:04 by charles #+# #+# */ +/* Updated: 2020/04/15 06:47:27 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef EASYFIND_HPP +# define EASYFIND_HPP + +# include <algorithm> + +template<typename T> +typename T::iterator easyfind(T& container, int x) +{ + return std::find(container.begin(), container.end(), x); +} + +#endif |
