|
Blender V4.3
|
#include <BLI_function_ref.hh>
Public Member Functions | |
| FunctionRef ()=default | |
| FunctionRef (std::nullptr_t) | |
| template<typename Callable , BLI_ENABLE_IF(( !std::is_same_v< std::remove_cv_t< std::remove_reference_t< Callable > >, FunctionRef >)) , BLI_ENABLE_IF((std::is_invocable_r_v< Ret, Callable, Params... >)) > | |
| FunctionRef (Callable &&callable) | |
| Ret | operator() (Params... params) const |
| operator bool () const | |
Definition at line 76 of file BLI_function_ref.hh.
|
default |
|
inline |
Definition at line 102 of file BLI_function_ref.hh.
|
inline |
A FunctionRef itself is a callable as well. However, we don't want that this constructor is called when Callable is a FunctionRef. If we would allow this, it would be easy to accidentally create a FunctionRef that internally calls another FunctionRef. Usually, when assigning a FunctionRef to another, we want that both contain a reference to the same underlying callable afterwards.
It is still possible to reference another FunctionRef by first wrapping it in another lambda.
Definition at line 118 of file BLI_function_ref.hh.
|
inline |
Returns true, when the FunctionRef references a function currently. If this returns false, the FunctionRef must not be called.
Definition at line 139 of file BLI_function_ref.hh.
|
inline |
Call the referenced function and forward all parameters to it.
This invokes undefined behavior if the FunctionRef does not reference a function currently.
Definition at line 129 of file BLI_function_ref.hh.
References BLI_assert, and params.