CppCommon
1.0.4.1
C++ Common Library
|
Allocation free function. More...
#include <function.h>
Public Member Functions | |
Function () noexcept | |
Function (std::nullptr_t) noexcept | |
Function (const Function &function) noexcept | |
Function (Function &&function) noexcept | |
template<class TFunction > | |
Function (TFunction &&function) noexcept | |
~Function () noexcept | |
Function & | operator= (std::nullptr_t) noexcept |
Function & | operator= (const Function &function) noexcept |
Function & | operator= (Function &&function) noexcept |
template<typename TFunction > | |
Function & | operator= (TFunction &&function) noexcept |
template<typename TFunction > | |
Function & | operator= (std::reference_wrapper< TFunction > function) noexcept |
operator bool () const noexcept | |
Check if the function is valid. More... | |
R | operator() (Args... args) |
Invoke the function. More... | |
void | swap (Function &function) noexcept |
Swap two instances. More... | |
template<typename TFunction > | |
Function< R(Args...), Capacity > & | operator= (TFunction &&function) noexcept |
template<typename TFunction > | |
Function< R(Args...), Capacity > & | operator= (std::reference_wrapper< TFunction > function) noexcept |
Friends | |
template<class UR , class... UArgs, size_t UCapacity> | |
void | swap (Function< UR(UArgs...), UCapacity > &function1, Function< UR(UArgs...), UCapacity > &function2) noexcept |
Allocation free function.
Allocation free function uses internal stack-based buffer to keep the closure. This allows to avoid slow heap allocation in function constructor as it performed in std::function implementation.
Invocation overhead is similar to std::function implementation.
Definition at line 30 of file function.h.
|
inlinenoexcept |
Definition at line 12 of file function.inl.
|
inlinenoexcept |
Definition at line 20 of file function.inl.
|
inlinenoexcept |
Definition at line 26 of file function.inl.
|
inlinenoexcept |
Definition at line 38 of file function.inl.
|
inlinenoexcept |
Definition at line 46 of file function.inl.
|
inlinenoexcept |
Definition at line 63 of file function.inl.
|
inlineexplicitnoexcept |
Check if the function is valid.
Definition at line 50 of file function.h.
|
inline |
Invoke the function.
Definition at line 112 of file function.inl.
|
inlinenoexcept |
Definition at line 82 of file function.inl.
|
inlinenoexcept |
Definition at line 89 of file function.inl.
|
inlinenoexcept |
Definition at line 70 of file function.inl.
|
noexcept |
|
inlinenoexcept |
Definition at line 105 of file function.inl.
|
noexcept |
|
inlinenoexcept |
Definition at line 97 of file function.inl.
|
inlinenoexcept |
Swap two instances.
Definition at line 144 of file function.inl.
|
friend |