MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / Subrange

Class Subrange

develop/matchit/patterns.h:17–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 {
16 template <typename I, typename S = I>
17 class Subrange
18 {
19 I mBegin;
20 S mEnd;
21
22 public:
23 constexpr Subrange(I const begin, S const end) : mBegin{begin}, mEnd{end} {}
24
25 constexpr Subrange(Subrange const &other)
26 : mBegin{other.begin()}, mEnd{other.end()} {}
27
28 Subrange &operator=(Subrange const &other)
29 {
30 mBegin = other.begin();
31 mEnd = other.end();
32 return *this;
33 }
34
35 size_t size() const
36 {
37 return static_cast<size_t>(std::distance(mBegin, mEnd));
38 }
39 auto begin() const { return mBegin; }
40 auto end() const { return mEnd; }
41 };
42
43 template <typename I, typename S>
44 constexpr auto makeSubrange(I begin, S end)

Callers

nothing calls this directly

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected