to_stream.hpp

1
2
3
4
5
6
7
8
#pragma once


#include <felspar/coro/generator.hpp>
#include <felspar/coro/stream.hpp>


namespace felspar::coro {

Convert a generator<V> to a stream<V>

12
13
14
15
16
17
18
    template<typename V>
    inline stream<V> to_stream(generator<V> g) {
        for (auto &&v : g) { co_yield std::move(v); }
    }


}