15 namespace TrackFindingCDC {
18 template <
class AFunctor>
31 template <class Ts, class Category = decltype(m_functor(*std::declval<Ts>().begin()))>
34 auto it = std::begin(ts);
35 auto itEnd = std::end(ts);
36 if (it == itEnd)
return {};
38 for (; it != itEnd; ++it) {
39 if (category !=
m_functor(*it))
return {};
49 template<class T1, class T2, class Category = decltype(m_functor(std::declval<T1>()))>
50 std::optional<Category>
operator()(
const T1& t1,
const T2& t2)
const
54 if (cat1 == cat2)
return {cat1};
Abstract base class for different kinds of events.
Adapter of a category function to find the common category of several objects.
std::optional< Category > operator()(const Ts &ts) const
Returns the common category value of a range.
std::optional< Category > operator()(const T1 &t1, const T2 &t2) const
Returns the common category of two values.
AFunctor m_functor
Memory for the nested functor.