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

Class __env

include/stdexec/__detail/__task.hpp:715–754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713 };
714
715 struct __env
716 {
717 template <__one_of<get_scheduler_t, get_start_scheduler_t> _Tag>
718 [[nodiscard]]
719 constexpr auto query(_Tag) const noexcept -> start_scheduler_type
720 {
721 return __promise_->__state_->__sch_;
722 }
723
724 [[nodiscard]]
725 constexpr auto query(get_allocator_t) const noexcept -> allocator_type
726 {
727 return __promise_->__state_->__get_allocator();
728 }
729
730 [[nodiscard]]
731 constexpr auto query(get_stop_token_t) const noexcept -> stop_token_type
732 {
733 if (__promise_->__stop_.index() == 0)
734 {
735 return __var::__get<0>(__promise_->__stop_).get_token();
736 }
737 else
738 {
739 return __var::__get<1>(__promise_->__stop_);
740 }
741 }
742
743 template <__forwarding_query _Query, class... _Args>
744 requires __queryable_with<_TaskEnv, _Query, _Args...>
745 [[nodiscard]]
746 constexpr auto query(_Query, _Args&&... __args) const
747 noexcept(__nothrow_queryable_with<_TaskEnv, _Query, _Args...>)
748 -> __query_result_t<_TaskEnv, _Query, _Args...>
749 {
750 return __query<_Query>()(__promise_->__state_->__env_, static_cast<_Args&&>(__args)...);
751 }
752
753 __promise const * __promise_;
754 };
755
756 __stop_variant_t __stop_{__no_init};
757 __awaiter_base* __state_ = nullptr;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected