diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-04-15 09:28:09 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-04-15 09:29:39 +0200 |
| commit | 52a866baba3cbb05ecf0be88f1b50991b4a26b52 (patch) | |
| tree | 70d32f262c8faddce90ce71cce046019da8b10dd /cpp08/ex00/easyfind.hpp | |
| parent | 7ac812044bfe771178752a52d70b18bb297c1891 (diff) | |
| download | piscine_cpp-52a866baba3cbb05ecf0be88f1b50991b4a26b52.tar.gz piscine_cpp-52a866baba3cbb05ecf0be88f1b50991b4a26b52.tar.bz2 piscine_cpp-52a866baba3cbb05ecf0be88f1b50991b4a26b52.zip | |
cpp08 probably done, ex02 has a useless file in this implementation?
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 |
