MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / __defaults

Class __defaults

include/stdexec/__detail/__basic_sender.hpp:150–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 __applicable<__connect_t<_Sexpr>, _Sexpr, __state_type_t<_Sexpr, _Receiver>&>;
149
150 struct __defaults
151 {
152 static constexpr auto __get_attrs = //
153 [](__ignore, __ignore, auto const &... __child) noexcept -> decltype(auto)
154 {
155 if constexpr (sizeof...(__child) == 1)
156 {
157 return __fwd_env(STDEXEC::get_env(__child...));
158 }
159 else
160 {
161 return env<>();
162 }
163 };
164
165 static constexpr auto __get_state = //
166 []<class _Sender, class _Receiver>(_Sender&& __sndr, _Receiver&& __rcvr) noexcept(
167 __nothrow_decay_copyable<__data_of<_Sender>>) -> decltype(auto)
168 {
169 return __state{static_cast<_Receiver&&>(__rcvr),
170 STDEXEC::__get<1>(static_cast<_Sender&&>(__sndr))};
171 };
172
173 static constexpr auto __get_env = //
174 []<class _State>(__ignore, _State const & __state) noexcept //
175 -> env_of_t<decltype(_State::__rcvr_)>
176 {
177 return STDEXEC::get_env(__state.__rcvr_);
178 };
179
180 static constexpr auto __connect = //
181 []<class _Receiver, __connectable_to<_Receiver> _Sender>(_Sender&& __sndr,
182 _Receiver&& __rcvr) noexcept( //
183 __nothrow_constructible_from<__opstate<_Sender, _Receiver>, _Sender, _Receiver>)
184 -> __opstate<_Sender, _Receiver>
185 {
186 return __opstate<_Sender, _Receiver>(static_cast<_Sender&&>(__sndr),
187 static_cast<_Receiver&&>(__rcvr));
188 };
189
190 static constexpr auto __submit = //
191 [] {
192 };
193
194 static constexpr auto __start = //
195 []<class... _ChildOps>(__ignore, _ChildOps&... __ops) noexcept
196 {
197 static_assert(sizeof...(_ChildOps) > 0);
198 (STDEXEC::start(__ops), ...);
199 };
200
201 static constexpr auto __complete = //
202 []<class _Idx, class _State, class _Set, class... _As>(_Idx,
203 _State& __state,
204 _Set,
205 _As&&... __as) noexcept -> void
206 {
207 static_assert(_Idx::value == 0, "I don't know how to complete this operation.");

Callers

nothing calls this directly

Calls 2

get_envFunction · 0.70
startFunction · 0.50

Tested by

no test coverage detected