「✨」 feat: ex00 :D
This commit is contained in:
11
ex00/easyfind.hpp
Normal file
11
ex00/easyfind.hpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user