|
| template<auto & fn> |
| constexpr function_tag< fn > | tag_of (decltype(fn)&) |
| | Creates a compile-time identity tag for a free function.
|
| |
| template<typename Functor, typename = std::enable_if_t< !std::is_same_v< std::decay_t< Functor >, function > >> |
| | function (Functor &&f) noexcept(use_sbo< std::decay_t< Functor > >()) |
| | Constructs a function from a compatible callable.
|
| |
| | function (function const &other) |
| | Copy-constructs a function and its stored callable.
|
| |
| | function (function &&other) noexcept |
| | Move-constructs a function, leaving other empty when it owns heap storage.
|
| |
| function & | operator= (function const &other) |
| | Copy-assigns a function and its stored callable.
|
| |
| function & | operator= (function &&other) noexcept |
| | Move-assigns a function.
|
| |
| | operator bool () const noexcept |
| | Tests whether a callable is stored.
|
| |
| R | operator() (Args... args) |
| | Invokes the stored callable.
|
| |
| bool | operator== (std::nullptr_t) const noexcept |
| | Tests whether the function is empty.
|
| |
template<typename R, typename... Args>
class rpnx::function< R(Args...) >
Owning, copyable type-erased callable with small-buffer optimization.
Empty functions compare equal to nullptr and throw std::bad_function_call when invoked. Small nothrow-copyable callables are stored inline; other callables are heap allocated.
- Template Parameters
-
| R | Callable return type. |
| Args | Callable argument types. |
template<typename R, typename... Args>
template<typename Functor, typename = std::enable_if_t< !std::is_same_v< std::decay_t< Functor >, function > >>
Constructs a function from a compatible callable.
- Template Parameters
-
| Functor | Callable source type. |
- Parameters
-