Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::inline_function< Signature, BufferSize, IsNoexcept, Alignment > Class Template Reference

A function wrapper akin to std::function that always stores the wrapped invocable internally. More...

Detailed Description

template<typename Signature, std::size_t BufferSize = default_inline_function_size, bool IsNoexcept = false, std::size_t Alignment = default_inline_function_alignment>
class arene::base::inline_function< Signature, BufferSize, IsNoexcept, Alignment >

A function wrapper akin to std::function that always stores the wrapped invocable internally.

Template Parameters
SignatureThe signature of the function call operator.
BufferSizeThe size of the internal buffer. It defaults to 4 times the size of a pointer.
IsNoexceptIf true , the function will have a noexcept qualified call operator. Otherwise, it will not.
AlignmentThe alignment of the internal buffer. It defaults to alignof(std::max_align_t) .
Note
If the signature is const-qualified (e.g. int (int,double) const ) then the function call operator for this class will also be const-qualified. If the signature is not const-qualified, then only non-const objects will be invocable.
An invocable whose alignment requirement exceeds Alignment cannot be stored, because doing so would place it at an under-aligned address. Such an invocable is rejected by a static_assert. Note that std::is_constructible and std::is_assignable still report true for such an invocable.

The documentation for this class was generated from the following file: