14 lines
268 B
C++
14 lines
268 B
C++
#pragma once
|
|
|
|
#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;
|
|
}
|