std::execution::read(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

std::execution::read - std::execution::read β€” okay bestie, this is the whole manpage vibe for std::execution::read from the C++ Standard Libary manual (manual name folded in near the top, as promised 🫢). It’s giving β€œreach into a receiver’s environment” energy, and we’re obsessed ✨.


πŸ“œ Synopsis πŸ“œ

Synopsis time, no cap:

Defined in header <execution>
execution::sender auto read( auto tag );  (since C++26)

🌸 Parameters 🌸

  • tag β€” by which the customization point is recognized. That’s literally its whole job, iykyk πŸŽ€.

πŸ”₯ Return value πŸ”₯

Returns a sender πŸ’« β€” it reaches into a receiver’s environment and pulls out the current value associated with the customization point denoted by Tag. Capital-T Tag, keeping it iconic πŸ‘‘.


✨ Example ✨

Possible usage of tags in read function, to retrieve the value associated with the customization point β€” here’s the whole flex, fr fr πŸ’…:

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);
}

okay that’s the whole page, bestie 🫢 β€” cute little sign-off time: source is http://cppreference.com, version/date is 2024.06.10, and this iconic manual page is std::execution::read(3). mwah πŸ’‹πŸŒˆ

πŸ“¦ where this page comes from