hpx/functional/invoke_fused.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 F, typename Tuple>
constexpr detail::invoke_fused_result<F, Tuple>::type invoke_fused(F &&f, Tuple &&t) noexcept(noexcept(detail::invoke_fused_impl(detail::fused_index_pack_t<Tuple>{}, HPX_FORWARD(F, f), HPX_FORWARD(Tuple, t))))#

Invokes the given callable object f with the content of the sequenced type t (tuples, pairs).

Note

This function is similar to std::apply (C++17). The difference between hpx::invoke and hpx::invoke_fused is that the later unpacks the tuples while the former cannot. Turning a tuple into a parameter pack is not a trivial operation which makes hpx::invoke_fused rather useful.

Parameters
  • f – Must be a callable object. If f is a member function pointer, the first argument in the sequenced type will be treated as the callee (this object).

  • t – A type whose contents are accessible through a call to hpx::get.

Throws

std::exception – like objects thrown by call to object f with the arguments contained in the sequenceable type t.

Returns

The result of the callable object when it’s called with the content of the given sequenced type.

template<typename R, typename F, typename Tuple>
constexpr R invoke_fused_r(F &&f, Tuple &&t) noexcept(noexcept(detail::invoke_fused_impl(detail::fused_index_pack_t<Tuple>{}, HPX_FORWARD(F, f), HPX_FORWARD(Tuple, t))))#

Invokes the given callable object f with the content of the sequenced type t (tuples, pairs).

Note

This function is similar to std::apply (C++17). The difference between hpx::invoke and hpx::invoke_fused is that the later unpacks the tuples while the former cannot. Turning a tuple into a parameter pack is not a trivial operation which makes hpx::invoke_fused rather useful.

Note

The difference between hpx::invoke_fused and hpx::invoke_fused_r is that the later allows to specify the return type as well.

Parameters
  • f – Must be a callable object. If f is a member function pointer, the first argument in the sequenced type will be treated as the callee (this object).

  • t – A type whose contents are accessible through a call to hpx::get.

Throws

std::exception – like objects thrown by call to object f with the arguments contained in the sequenceable type t.

Template Parameters

R – The result type of the function when it’s called with the content of the given sequenced type.

Returns

The result of the callable object when it’s called with the content of the given sequenced type.