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.

Defines

HPX_UTIL_REGISTER_UNIQUE_FUNCTION_DECLARATION(Sig, F, Name)#
HPX_UTIL_REGISTER_UNIQUE_FUNCTION(Sig, F, Name)#
namespace hpx

Top level namespace.

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

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.

template<typename R, typename ...Ts, bool Serializable>
class move_only_function<R(Ts...), Serializable> : public util::detail::basic_function<R(Ts...), false, Serializable>#

Public Types

using result_type = R#

Public Functions

inline constexpr move_only_function(std::nullptr_t = nullptr) noexcept#
move_only_function(move_only_function const&) = delete#
move_only_function(move_only_function&&) noexcept = default#
move_only_function &operator=(move_only_function const&) = delete#
move_only_function &operator=(move_only_function&&) noexcept = default#
~move_only_function() = default#
template<typename F, typename FD = std::decay_t<F>, typename Enable1 = std::enable_if_t<!std::is_same_v<FD, move_only_function>>, typename Enable2 = std::enable_if_t<is_invocable_r_v<R, FD&, Ts...>>>
inline move_only_function(F &&f)#
template<typename F, typename FD = std::decay_t<F>, typename Enable1 = std::enable_if_t<!std::is_same_v<FD, move_only_function>>, typename Enable2 = std::enable_if_t<is_invocable_r_v<R, FD&, Ts...>>>
inline move_only_function &operator=(F &&f)#

Private Types

using base_type = util::detail::basic_function<R(Ts...), false, Serializable>#
namespace distributed

Typedefs

template<typename Sig>
using move_only_function = hpx::move_only_function<Sig, true>#
namespace util