hpx::move_only_function

hpx::move_only_function#

Defined in header hpx/functional.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

template<typename Sig, bool Serializable = false>
class move_only_function#

Class template hpx::move_only_function is a general-purpose polymorphic function wrapper. hpx::move_only_function objects can store and invoke any constructible (not required to be move constructible) Callable target &#8212; functions, lambda expressions, bind expressions, or other function objects, as well as pointers to member functions and pointers to member objects.

The stored callable object is called the target of hpx::move_only_function. If an hpx::move_only_function contains no target, it is called empty. Unlike hpx::function, invoking an empty hpx::move_only_function results in undefined behavior.

hpx::move_only_functions supports every possible combination of cv-qualifiers, ref-qualifiers, and noexcept-specifiers not including volatile provided in its template parameter. These qualifiers and specifier (if any) are added to its operator(). hpx::move_only_function satisfies the requirements of MoveConstructible and MoveAssignable, but does not satisfy CopyConstructible or CopyAssignable.