28 explicit RangeIter(T end) : incr(0), cur(end), fin(end) {}
32 : incr(start <= end ? 1 : -1), cur(start), fin(
static_cast<T
>(end + incr)) {}
35 T operator*()
const {
return cur; }
36 bool operator==(
const RangeIter &a)
const {
return cur == a.cur; }
37 bool operator!=(
const RangeIter &a)
const {
return cur != a.cur; }
39 cur =
static_cast<T
>(cur + incr);
43 friend std::ostream &operator<<(std::ostream &,
const RangeIter<U> &);
51static inline RangeIter<T> Range(std::pair<T, T> p) {
52 return RangeIter<T>(p.first, p.second);
55static inline RangeIter<T> ReverseRange(std::pair<T, T> p) {
56 return RangeIter<T>(p.second, p.first);
60std::ostream &operator<<(std::ostream &out,
const RangeIter<T> &r) {
62 if (r.cur + r.incr != r.fin) out <<
".." << (r.fin - r.incr);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24