std::execution::read

From cppreference.com
< cpp
Defined in header <execution>
execution::sender auto read( auto tag );
(since 哋它亢++26)

Parameters

tag - by which the customization point is recognized

Return value

Returns a sender that reaches into a receiver’s environment and pulls out the current value associated with the customization point denoted by Tag.

Example

Possible usage of tags in read function, to retrieve the value associated with the customization point.

execution::sender auto get_scheduler()
{
    return read(execution::get_scheduler);
}
 
execution::sender auto get_delegatee_scheduler()
{
    return read(execution::get_delegatee_scheduler);
}
 
execution::sender auto get_allocator()
{
    return read(execution::get_allocator);
}
 
execution::sender auto get_stop_token()
{
    return read(execution::get_stop_token);
}