Files
cpp08/ex00/easyfind.hpp
2025-08-25 12:08:16 +02:00

12 lines
254 B
C++

#include <algorithm>
template <typename T>
typename T::iterator easyfind(T &value, int what)
{
typename T::iterator it = std::find(value.begin(), value.end(), what);
if (it == value.end())
throw std::runtime_error("value not found");
return it;
}