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

Class __with_default

include/stdexec/functional.hpp:202–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201 template <class _Fn, class _Default>
202 struct __with_default : _Fn
203 {
204 STDEXEC_ATTRIBUTE(host, device, always_inline)
205 constexpr __with_default(_Fn __fn, _Default __default)
206 noexcept(__nothrow_move_constructible<_Fn>)
207 : _Fn(static_cast<_Fn &&>(__fn))
208 , __default_(static_cast<_Default &&>(__default))
209 {}
210
211 using _Fn::operator();
212
213 template <class... _As>
214 requires(!__callable<_Fn const &, _As...>)
215 STDEXEC_ATTRIBUTE(host, device, always_inline)
216 constexpr auto
217 operator()(_As &&...) const noexcept(__nothrow_copy_constructible<_Default>) -> _Default
218 {
219 return __default_;
220 }
221
222 _Default __default_{};
223 };
224
225 template <class _Fn, class _Default>
226 STDEXEC_HOST_DEVICE_DEDUCTION_GUIDE

Callers 5

__queryFunction · 0.85
__transform_senderFunction · 0.85
operator deleteMethod · 0.85
noexceptMethod · 0.85
__mk_sh_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected