-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIteratorRange.h
More file actions
33 lines (27 loc) · 805 Bytes
/
Copy pathIteratorRange.h
File metadata and controls
33 lines (27 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/** ======================================================================+
+ Copyright @2020-2021 Arjun Ray
+ Released under MIT License
+ see https://mit-license.org
+========================================================================*/
#pragma once
namespace Utility
{
// IteratorRange.
// Transformer to support C++ ranged-for syntax
//
template<typename Iterator>
class IteratorRange
{
public:
IteratorRange(Iterator begin, Iterator end)
: begin_(begin)
, end_(end)
{}
using iterator = Iterator;
iterator begin() const { return begin_; }
iterator end() const { return end_; }
private:
Iterator begin_;
Iterator end_;
};
} // namespace Utility