35template<
class F,
class U =
void>
63 std::unique_ptr<F> _ownF;
65 std::shared_ptr<F> _sharedF;
97 template<
typename... Args>
100 return _f->operator()(std::forward<Args>(args)...);
104 typename std::add_lvalue_reference<F>::type
operator*()
const;
106 typename std::add_pointer<F>::type
operator->() const noexcept;
115 operator
bool() const;
127 template<typename G = F>
128 auto
toShared() -> typename std::enable_if< util::has_identity_functor<G>::value, std::shared_ptr<F>>::type;
130 template<typename G = F>
131 auto
toShared() -> typename std::enable_if<!util::has_identity_functor<G>::value, std::shared_ptr<F>>::type;
Smart pointer for managing the various ways of passing functors around.
bool operator()(Args... args)
Perfect forwarding functor operator.
auto toShared() -> typename std::enable_if< util::has_identity_functor< G >::value, std::shared_ptr< F > >::type
Lifts managed functor reference for usage in std::shared_ptr<F> arithmetic.
FunctorPtr(FunctorPtr &&)=default
Move constructor.
std::add_pointer< F >::type operator->() const noexcept
Enable pointer-like access to the exposed functor's members.
FunctorPtr()
Constructor for an empty instance.
bool isOwning() const
Indicates whether a functor instance is both exposed and owned.
FunctorPtr(FunctorPtr &)=delete
Copy construction is disabled as it is incompatible with unique ownership.
std::add_lvalue_reference< F >::type operator*() const
Top level namespace for all of OpenLB.
Indicates existence of F::identity_functor_type typedef.