1 #ifndef SIPLASPLAS_UTILITY_MEMBERFUNCTOR_HPP 2 #define SIPALSPLAS_UTILITY_MEMBERFUNCTOR_HPP 47 template<typename F, bool Ebo = IsEboCandidate<F>::value>
54 template<
typename... Args>
56 F{std::forward<Args>(args)...}
63 template<
typename... Args>
64 constexpr decltype(
auto)
invoke(Args&&... args)
const 66 return F::operator()(std::forward<Args>(args)...);
73 template<
typename... Args>
74 constexpr decltype(
auto)
invoke(Args&&... args)
76 return F::operator()(std::forward<Args>(args)...);
82 constexpr
const F&
get()
const 84 return *
static_cast<const F*
>(
this);
92 return *
static_cast<F*
>(
this);
100 template<
typename... Args>
102 _functor{std::forward<Args>(args)...}
105 template<
typename... Args>
106 constexpr decltype(
auto)
invoke(Args&&... args)
const 108 return _functor(std::forward<Args>(args)...);
111 template<
typename... Args>
112 constexpr decltype(
auto)
invoke(Args&&... args)
114 return _functor(std::forward<Args>(args)...);
117 constexpr
const F&
get()
const 133 #endif // SIPLASPLAS_UTILITY_MEMBERFUNCTOR_HPP Definition: messaging.hpp:8
Implements optimal-storage for a functor that will be used as member of a class.
Definition: memberfunctor.hpp:48
::cpp::meta::bool_<(sizeof(::cpp::meta::inherit< T, ::cpp::meta::aggregate< int >>)==sizeof(int)) > IsEboCandidate
Checks if a type is a candidate for the Empty Base Optimization (EBO)
Definition: memberfunctor.hpp:26
decltype(auto) constexpr invoke(Args &&... args) const
Invokes the member functor with the given arguments.
Definition: memberfunctor.hpp:64
constexpr MemberFunctor(Args &&... args)
Initializes a member functor with the given arguments.
Definition: memberfunctor.hpp:55