Belle II Software  release-08-01-10
Alternation< AFunctor1, AFunctor2 > Struct Template Reference

Generic functor to try to functors and choose the first to be applicable. More...

#include <Functional.h>

Public Member Functions

 operator FunctorTag ()
 Marker function for the isFunctor test.
 
 Alternation ()=default
 Allow default construction.
 
 Alternation (const AFunctor1 &functor1, const AFunctor2 &functor2=AFunctor2())
 Constructor from the nested functors.
 
template<class... T>
auto impl (int favouredTag, T &&... t) const -> decltype(m_functor1(std::forward< T >(t)...))
 Implementation applying the first functor. Favoured option.
 
template<class... T>
auto impl (long disfavouredTag, T &&... t) const -> decltype(m_functor2(std::forward< T >(t)...))
 Implementation applying the second functor. Disfavoured option.
 
template<class... T>
auto operator() (T &&... t) const -> decltype(this->impl(0, std::forward< T >(t)...))
 Operator to dispatch to the two functors and returns the first applicable option.
 

Private Attributes

AFunctor1 m_functor1
 Memory for the first nested functor.
 
AFunctor2 m_functor2
 Memory for the second nested functor.
 

Detailed Description

template<class AFunctor1, class AFunctor2>
struct Belle2::TrackFindingCDC::Alternation< AFunctor1, AFunctor2 >

Generic functor to try to functors and choose the first to be applicable.

Definition at line 180 of file Functional.h.


The documentation for this struct was generated from the following file: