| 2020 | /// This generator is async-reentrant |
| 2021 | template <typename T> |
| 2022 | AsyncGenerator<T> MakeCancellable(AsyncGenerator<T> source, StopToken stop_token) { |
| 2023 | return CancellableGenerator<T>{std::move(source), std::move(stop_token)}; |
| 2024 | } |
| 2025 | |
| 2026 | template <typename T> |
| 2027 | class DefaultIfEmptyGenerator { |