iceoryx_hoofs 2.0.5
|
cxx::function_ref is a non-owning reference to a callable. More...
#include <iceoryx_hoofs/cxx/function_ref.hpp>
Public Member Functions | |
function_ref () noexcept | |
Creates an empty function_ref in an invalid state. | |
function_ref (const function_ref &) noexcept=default | |
function_ref & | operator= (const function_ref &) noexcept=default |
template<typename CallableType , typename = std::enable_if_t<!is_function_pointer<CallableType>::value && !has_same_decayed_type<CallableType, function_ref>::value && is_invocable<CallableType, ArgTypes...>::value>> | |
function_ref (CallableType &&callable) noexcept | |
Creates a function_ref with a callable whose lifetime has to be longer than function_ref. | |
function_ref (ReturnType(*function)(ArgTypes...)) noexcept | |
Creates a function_ref from a function pointer. | |
function_ref (function_ref &&rhs) noexcept | |
function_ref & | operator= (function_ref &&rhs) noexcept |
ReturnType | operator() (ArgTypes... args) const noexcept |
Calls the provided callable. | |
operator bool () const noexcept | |
Checks whether a valid target is contained. | |
void | swap (function_ref &rhs) noexcept |
Swaps the contents of two function_ref's. | |
cxx::function_ref is a non-owning reference to a callable.
It has these features: * No heap usage * No exceptions * Stateful lambda support * C++11/14 support
|
noexcept |
Creates an empty function_ref in an invalid state.
|
noexcept |
Creates a function_ref with a callable whose lifetime has to be longer than function_ref.
[in] | callable | that is not a function_ref |
|
noexcept |
Creates a function_ref from a function pointer.
[in] | function | function pointer to function we want to reference |
|
explicitnoexcept |
Checks whether a valid target is contained.
|
noexcept |
Calls the provided callable.
[in] | Arguments | are forwarded to the underlying function pointer |
|
noexcept |
Swaps the contents of two function_ref's.
[in] | Reference | to another function_ref |