Belle II Software development
|
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. | |
Generic functor to try to functors and choose the first to be applicable.
Definition at line 180 of file Functional.h.
|
inlineexplicit |
Constructor from the nested functors.
Definition at line 198 of file Functional.h.
|
inline |
Implementation applying the first functor. Favoured option.
Definition at line 207 of file Functional.h.
|
inline |
Implementation applying the second functor. Disfavoured option.
Definition at line 215 of file Functional.h.
|
inline |
Operator to dispatch to the two functors and returns the first applicable option.
Definition at line 224 of file Functional.h.
|
private |
Memory for the first nested functor.
Definition at line 188 of file Functional.h.
|
private |
Memory for the second nested functor.
Definition at line 191 of file Functional.h.