Jlm
Loading...
Searching...
No Matches
iterator_range.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2021 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#ifndef JLM_UTIL_ITERATOR_RANGE_HPP
7#define JLM_UTIL_ITERATOR_RANGE_HPP
8
9#include <utility>
10
11namespace jlm::util
12{
13
18template<typename T>
20{
21public:
23 : begin_(std::move(begin)),
24 end_(std::move(end))
25 {}
26
27 template<typename container_t>
28 explicit IteratorRange(container_t && c)
29 : begin_(c.begin()),
30 end_(c.end())
31 {}
32
33 T
34 begin() const
35 {
36 return begin_;
37 }
38
39 T
40 end() const
41 {
42 return end_;
43 }
44
45private:
47};
48
49}
50
51#endif
IteratorRange(T begin, T end)
IteratorRange(container_t &&c)