I have a functor that works on a container of type U elements of type T , for example,
template<typename T, template<typename...> class U> class asserter { public: asserter(U<T> &c) : container(c) { }; void operator()(T lhs) { CU_ASSERT(container.find(lhs) != container.end()); }; private: U<T> &container; };
which i could use as
std::set<std::string> a, c; ... asserter<std::string, std::set> ass(c); for_each(a.begin(), a.end(), ass);
We are currently ignoring std::includes() .
This works fine if the U::find() parameter is specified in the container. If this is not the case, I would like to return to std::find() . On the other hand, I would prefer to use U::find() over std::find() , if available.
In C ++ 11 (or 17, if necessary) can I determine if U::find() (possibly limited to STL) for U, and if it uses it, otherwise use std::find() ?
c ++ c ++ 11 stl traits sfinae
Michael conlen
source share