// // iota.h // stream // // Created by Sam Jaffe on 3/29/23. // #pragma once #include #include #include #include namespace stream::ranges { template struct iota_view : public view_interface, iota_iterator, Bound> { private: T value_; Bound bound_; public: iota_view(T value, Bound bound) : value_(value), bound_(bound) {} auto begin() const { return iota_iterator(value_); } auto end() const { return bound_; } }; template struct iota_view : public view_interface, iota_iterator> { private: T value_; T bound_; public: iota_view(T value, T bound) : value_(value), bound_(bound) {} auto begin() const { return iota_iterator(value_); } auto end() const { return iota_iterator(bound_); } }; } namespace stream::ranges::views { template auto iota(T value, Bound bound) { return iota_view(value, bound); } } MAKE_ITERATOR_FACADE_TYPEDEFS_T(stream::ranges::iota_iterator); #include