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
>
usingtag_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
>
usingtag_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_invoke
name 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_invoke
is 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
bar
which 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");
-
template<typename
Tag
, typename ...Args
>
constexpr boolis_tag_invocable_v
= is_tag_invocable<Tag, Args...>::value¶ hpx::functional::is_tag_invocable_v<Tag, Args...>
evaluates tohpx::functional::is_tag_invocable<Tag, Args...>::value
-
template<typename
Tag
, typename ...Args
>
constexpr boolis_nothrow_tag_invocable_v
= is_nothrow_tag_invocable<Tag, Args...>::value¶ hpx::functional::is_tag_invocable_v<Tag, Args...>
evaluates tohpx::functional::is_tag_invocable<Tag, Args...>::value
-
template<typename
Tag
, typename ...Args
>
structis_nothrow_tag_invocable
¶ - #include <tag_invoke.hpp>
hpx::functional::is_nothrow_tag_invocable<Tag, Args...>
is std::true_type if an overload oftag_invoke(tag, args...)
can be found via ADL and is noexcept.
-
template<typename
Tag
, typename ...Args
>
structis_tag_invocable
¶ - #include <tag_invoke.hpp>
hpx::functional::is_tag_invocable<Tag, Args...>
is std::true_type if an overload oftag_invoke(tag, args...)
can be found via ADL.
-
template<typename
Tag
>
structtag
¶ - #include <tag_invoke.hpp>
hpx::functional::tag<Tag>
defines a base class that implements the necessary tag dispatching functionality for a given typeTag
-
template<typename
Tag
>
structtag_noexcept
¶ - #include <tag_invoke.hpp>
hpx::functional::tag_noexcept<Tag>
defines a base class that implements the necessary tag dispatching functionality for a given typeTag
The implementation has to be noexcept
-
template<typename
-
namespace