Corrade::Containers::FunctionData class new in Git master

Function data storage

Type-erased base for Function. Suitable for storing type-erased function pointers in containers, see Type-erased function storage for more information.

Derived classes

template<class R, class ... Args>
class Function<R(Args...)> new in Git master
Function wrapper.

Constructors, destructors, conversion operators

FunctionData(std::nullptr_t = nullptr) noexcept
Default constructor.
FunctionData(const FunctionData&) deleted
Copying is not allowed.
FunctionData(FunctionData&&) noexcept
Move constructor.
operator bool() const explicit
Whether the function pointer is non-null.

Public functions

auto operator=(const FunctionData&) -> FunctionData& deleted
Copying is not allowed.
auto operator=(FunctionData&&) -> FunctionData& noexcept
Move assignment.
auto isAllocated() const -> bool
Whether the instance contains heap-allocated state.

Function documentation

Corrade::Containers::FunctionData::FunctionData(std::nullptr_t = nullptr) noexcept

Default constructor.

Creates a nullptr function.

Corrade::Containers::FunctionData::operator bool() const explicit

Whether the function pointer is non-null.

Returns false if the instance was default-constructed, constructed from a nullptr free or member function pointer or moved out, true otherwise.

bool Corrade::Containers::FunctionData::isAllocated() const

Whether the instance contains heap-allocated state.

Returns true if the instance was created from a capturing lambda or a functor with a large or non-trivially copyable state, false otherwise. In other words, always returns false for default-constructed instances, free and member function pointers and instances constructed with the NoAllocateInitT constructor.