# std::execution::stopped_as_optional

> C++ Atlas: `cppatlas.com/w/cpp/execution/stopped_as_optional` | Source: https://en.cppreference.com/w/cpp/execution/stopped_as_optional | Domain: Execution | Standards: C++26

Returns a sender that maps the value channel from a T to an std::optional<std::decay_t<T>>, and maps the stopped channel to a value of an empty std::optional<std::decay_t<T>>.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <execution>
execution::sender auto stopped_as_optional( /*single-sender*/ auto snd ); // (since C++26)
```

### Parameters

- `snd` - input sender of which the value channel and stopped channel are mapped.

### Return value

Returns a sender that maps the value channel from a `T` to an `std::optional<std::decay_t<T>>`, and maps the stopped channel to a value of an empty `std::optional<std::decay_t<T>>`.

### Example

> Note: This section is incomplete Reason: no example

---
Attribution: content from https://en.cppreference.com/w/cpp/execution/stopped_as_optional (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.