std::execution::read_env

Header: <execution>

A sender factory that returns a sender that reaches into a receiver’s environment and pulls out the current value associated with a given query object.

# Declarations

inline constexpr /*unspecified*/ read_env{};

(since C++26) (customization point object)

Call signature
execution::sender auto read_env( auto&& query );

(since C++26)

# Example

std::execution::sender auto task =
  std::execution::read_env(std::execution::get_scheduler)
    | std::execution::let_value([](auto sched) {
        return std::execution::starts_on(sched, /*some nested work here*/);
    });
 
std::this_thread::sync_wait( std::move(task) ); // wait for it to finish