hpx/functional/tag_invoke.hpp#
Defined in header hpx/functional/tag_invoke.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace hpx
-
namespace functional#
Typedefs
-
template<typename Tag, typename ...Args>
using tag_invoke_result = invoke_result<decltype(tag_invoke), Tag, Args...># hpx::functional::tag_invoke_result<Tag, Args...>is the trait returning the result type of the call hpx::functional::tag_invoke. This can be used in a SFINAE context.
-
template<typename Tag, typename ...Args>
using tag_invoke_result_t = typename tag_invoke_result<Tag, Args...>::type# hpx::functional::tag_invoke_result_t<Tag, Args...>evaluates tohpx::functional::tag_invoke_result_t<Tag, Args...>::type
Variables
-
constexpr unspecified tag_invoke = unspecified#
The
hpx::functional::tag_invokename defines a constexpr object that is invocable with one or more arguments. The first argument is a ‘tag’ (typically a CPO). It is only invocable if an overload of tag_invoke() that accepts the same arguments could be found via ADL.The evaluation of the expression
hpx::tag_invoke(tag, args...)is equivalent to evaluating the unqualified call totag_invoke(decay-copy(tag), HPX_FORWARD(Args, args)...).hpx::functional::tag_invokeis implemented against P1895.Example: Defining a new customization point
foo:namespace mylib { inline constexpr struct foo_fn final : hpx::functional::tag<foo_fn> { } foo{}; }
Defining an object
barwhich customizesfoo:struct bar { int x = 42; friend constexpr int tag_invoke(mylib::foo_fn, bar const& x) { return b.x; } };
Using the customization point:
static_assert(42 == mylib::foo(bar{}), "The answer is 42");
-
namespace unspecified#
-
template<typename Tag, typename ...Args>
-
namespace functional#