di 0.1.0
Loading...
Searching...
No Matches
get_stop_token.h
Go to the documentation of this file.
1#pragma once
2
7#include "di/util/as_const.h"
8
9namespace di::execution {
10namespace detail {
11 struct GetStopTokenFunction : ForwardingQuery {
12 template<typename T>
13 constexpr auto operator()(T&& value) const -> concepts::StoppableToken auto {
14 if constexpr (concepts::TagInvocable<GetStopTokenFunction, T const&>) {
15 return function::tag_invoke(*this, util::as_const(value));
16 } else {
17 return sync::NeverStopToken {};
18 }
19 }
20
21 constexpr auto operator()() const;
22 };
23}
24
25constexpr inline auto get_stop_token = detail::GetStopTokenFunction {};
26}
Definition bulk.h:30
constexpr auto get_stop_token
Definition get_stop_token.h:25
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22