Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. template<typename IBegin, typename IEnd = IBegin>
  2. class Range {
  3. private:
  4.     IBegin begin_iterator;
  5.     IEnd end_iterator;
  6.  
  7. public:
  8.     constexpr Range(IBegin begin_, IEnd end_) noexcept : begin_iterator(std::move(begin_)), end_iterator(std::move(end_)) {}
  9.  
  10.     constexpr IBegin begin() const noexcept { return cbegin(); }
  11.     constexpr IEnd end() const noexcept { return cend(); }
  12.  
  13.     constexpr IBegin cbegin() const noexcept { return begin_iterator; }
  14.     constexpr IEnd cend() const noexcept { return end_iterator; }
  15. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement