#pragma once #include #include #include #include #include #include #include namespace stream::ranges { template class transform_view : public proxy_view_interface, S, transform_iterator, Proj> { public: using iterator = transform_iterator, Proj>; private: S stream_; Proj projection_; public: transform_view(S && stream, Proj projection) : stream_(FWD(stream)), projection_(projection) {} auto begin() const { return iterator(stream_.begin(), projection_); } auto end() const { return sentinel_end(this, stream_, projection_); } }; template transform_view(S &&, Proj) -> transform_view; } namespace stream::ranges::views { template class transform { public: transform(Proj const & projection) : projection_(projection) {} template friend auto operator|(Stream && stream, transform map) { // TODO: if constexpr transform_view return transform_view(FWD(stream), std::move(map.projection_)); } private: Proj projection_; }; } #include