hpx::mem_fn#

Defined in header hpx/functional.hpp.

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

namespace hpx

Top level namespace.

Functions

template<typename M, typename C>
constexpr detail::mem_fn<M C::*> mem_fn(M C::* pm) noexcept#

Function template hpx::mem_fn generates wrapper objects for pointers to members, which can store, copy, and invoke a pointer to member. Both references and pointers (including smart pointers) to an object can be used when invoking a hpx::mem_fn.

Parameters

pm – pointer to member that will be wrapped

Returns

a call wrapper of unspecified type with the following member:

template <typename... Ts>
constexpr typename util::invoke_result<MemberPointer, Ts...>::type
operator()(Ts&&... vs) noexcept;
Let fn be the call wrapper returned by a call to hpx::mem_fn with a pointer to member pm. Then the expression fn(t,a2,...,aN) is equivalent to HPX_INVOKE(pm,t,a2,...,aN). Thus, the return type of operator() is std::result_of<decltype(pm)(Ts&&...)>::type or equivalently std::invoke_result_t<decltype(pm),Ts&&...>, and the value in noexcept specifier is equal to std::is_nothrow_invocable_v<decltype(pm),Ts&&...>) . Each argument in vs is perfectly forwarded, as if by std::forward<Ts>(vs)… .

template<typename R, typename C, typename ...Ps>
constexpr detail::mem_fn<R (C::*)(Ps...)> mem_fn(R (C::* pm)(Ps...)) noexcept#

Function template hpx::mem_fn generates wrapper objects for pointers to members, which can store, copy, and invoke a pointer to member. Both references and pointers (including smart pointers) to an object can be used when invoking a hpx::mem_fn.

Parameters

pm – pointer to member that will be wrapped

Returns

a call wrapper of unspecified type with the following member:

template <typename... Ts>
constexpr typename util::invoke_result<MemberPointer, Ts...>::type
operator()(Ts&&... vs) noexcept;
Let fn be the call wrapper returned by a call to hpx::mem_fn with a pointer to member pm. Then the expression fn(t,a2,...,aN) is equivalent to HPX_INVOKE(pm,t,a2,...,aN). Thus, the return type of operator() is std::result_of<decltype(pm)(Ts&&...)>::type or equivalently std::invoke_result_t<decltype(pm),Ts&&...>, and the value in noexcept specifier is equal to std::is_nothrow_invocable_v<decltype(pm),Ts&&...>) . Each argument in vs is perfectly forwarded, as if by std::forward<Ts>(vs)… .

template<typename R, typename C, typename ...Ps>
constexpr detail::mem_fn<R (C::*)(Ps...) const> mem_fn(R (C::* pm)(Ps...) const) noexcept#

Function template hpx::mem_fn generates wrapper objects for pointers to members, which can store, copy, and invoke a pointer to member. Both references and pointers (including smart pointers) to an object can be used when invoking a hpx::mem_fn.

Parameters

pm – pointer to member that will be wrapped

Returns

a call wrapper of unspecified type with the following member:

template <typename... Ts>
constexpr typename util::invoke_result<MemberPointer, Ts...>::type
operator()(Ts&&... vs) noexcept;
Let fn be the call wrapper returned by a call to hpx::mem_fn with a pointer to member pm. Then the expression fn(t,a2,...,aN) is equivalent to HPX_INVOKE(pm,t,a2,...,aN). Thus, the return type of operator() is std::result_of<decltype(pm)(Ts&&...)>::type or equivalently std::invoke_result_t<decltype(pm),Ts&&...>, and the value in noexcept specifier is equal to std::is_nothrow_invocable_v<decltype(pm),Ts&&...>) . Each argument in vs is perfectly forwarded, as if by std::forward<Ts>(vs)… .