12 #include <boost/optional.hpp>
19 namespace TrackFindingCDC {
22 template <
class AFunctor>
35 template <class Ts, class Category = decltype(m_functor(*std::declval<Ts>().begin()))>
36 boost::optional<Category>
operator()(
const Ts& ts)
const
38 auto it = std::begin(ts);
39 auto itEnd = std::end(ts);
40 if (it == itEnd)
return {};
42 for (; it != itEnd; ++it) {
43 if (category !=
m_functor(*it))
return {};
53 template<class T1, class T2, class Category = decltype(m_functor(std::declval<T1>()))>
54 boost::optional<Category>
operator()(
const T1& t1,
const T2& t2)
const
58 if (cat1 == cat2)
return {cat1};