TermOx
range.hpp
1 #ifndef TERMOX_COMMON_RANGE_HPP
2 #define TERMOX_COMMON_RANGE_HPP
3 namespace ox {
4 
6 template <typename Iter_1, typename Iter_2>
7 struct Range {
8  public:
9  constexpr Range(Iter_1 begin, Iter_2 end) : begin_{begin}, end_{end} {}
10 
11  public:
13  [[nodiscard]] constexpr auto begin() const { return begin_; }
14 
16  [[nodiscard]] constexpr auto end() const { return end_; }
17 
18  private:
19  Iter_1 begin_;
20  Iter_2 const end_;
21 };
22 
23 } // namespace ox
24 #endif // TERMOX_COMMON_RANGE_HPP
Holds [begin, end) half-open range of iterators and provides access.
Definition: range.hpp:7
constexpr auto begin() const
Return the iterator to the beginning of the Range.
Definition: range.hpp:13
constexpr auto end() const
Return the iterator to the end of the Range.
Definition: range.hpp:16