I found
|
<details> |
|
<summary>Example</summary> |
|
The example shows a sender implementing an operation similar to <code><a href=‘#just’>just</a>(_value)</code>. |
|
|
|
```c++ |
|
struct example_sender |
|
{ |
|
template <std::execution::receiver Receiver> |
|
struct state |
|
{ |
|
using operation_state_concept = std::execution::operation_state_t; |
|
std::remove_cvref_t<Receiver> receiver; |
|
int value; |
|
auto start() & noexcept { |
|
std::execution::set_value( |
|
std::move(this->receiver), |
|
this->value |
|
); |
|
} |
|
}; |
|
using sender_concept = std::execution::sender_t; |
|
using completion_signatures = std::execution::completion_signatures< |
|
std::execution::set_value_t(int) |
|
>; |
|
|
|
int value{}; |
|
template <std::execution::receiver Receiver> |
|
auto connect(Receiver&& receiver) const -> state<Receiver> { |
|
return { std::forward<Receiver>(receiver), this->value }; |
|
} |
|
}; |
|
|
|
static_assert(std::execution::sender<example_sender>); |
completely by accident. This is an important example buried under several levels of ▶
Documentation being too verbose isn't a problem that needs a solution, in my opinion. Navigation is a separate problem from presentation.
I found
execution/docs/overview.md
Lines 190 to 222 in 9cd2e66
completely by accident. This is an important example buried under several levels of ▶
Documentation being too verbose isn't a problem that needs a solution, in my opinion. Navigation is a separate problem from presentation.