48#ifndef LASS_GUARDIAN_OF_INCLUSION_STDE_INTEGRAL_RANGE_H
49#define LASS_GUARDIAN_OF_INCLUSION_STDE_INTEGRAL_RANGE_H
52#include "../util/type_traits.h"
59template <
typename integral_type>
class const_integral_iterator;
61template <
typename I>
bool operator==(
const const_integral_iterator<I>& a,
const const_integral_iterator<I>& b);
62template <
typename I>
bool operator!=(
const const_integral_iterator<I>& a,
const const_integral_iterator<I>& b);
63template <
typename I>
bool operator< (
const const_integral_iterator<I>& a,
const const_integral_iterator<I>& b);
64template <
typename I>
bool operator> (
const const_integral_iterator<I>& a,
const const_integral_iterator<I>& b);
65template <
typename I>
bool operator<=(
const const_integral_iterator<I>& a,
const const_integral_iterator<I>& b);
66template <
typename I>
bool operator>=(
const const_integral_iterator<I>& a,
const const_integral_iterator<I>& b);
68template <
typename integral_type>
69class const_integral_iterator:
72 typedef const_integral_iterator<integral_type> self_type;
73 typedef std::random_access_iterator_tag iterator_category;
74 typedef integral_type value_type;
75 typedef std::ptrdiff_t difference_type;
76 typedef const integral_type* pointer;
77 typedef const integral_type& reference;
79 const_integral_iterator(value_type value, value_type step);
81 pointer operator->()
const;
82 reference operator*()
const;
83 value_type operator[](difference_type n)
const;
85 self_type& operator++();
86 self_type operator++(
int);
87 self_type& operator--();
88 self_type operator--(
int);
90 self_type& operator+=(difference_type n);
91 self_type& operator-=(difference_type n);
92 self_type operator+(difference_type n)
const;
93 self_type operator-(difference_type n)
const;
95 difference_type operator-(
const self_type& other)
const;
99 friend bool operator== <integral_type>(
const const_integral_iterator<integral_type>&,
const const_integral_iterator<integral_type>& );
100 friend bool operator< <integral_type>(
const const_integral_iterator<integral_type>&,
const const_integral_iterator<integral_type>& );
102 integral_type value_;
108template <
typename integral_type>
class integral_range_t;
110template <
typename I>
bool operator==(
const integral_range_t<I>& a,
const integral_range_t<I>& b);
111template <
typename I>
bool operator!=(
const integral_range_t<I>& a,
const integral_range_t<I>& b);
112template <
typename I>
bool operator< (
const integral_range_t<I>& a,
const integral_range_t<I>& b);
113template <
typename I>
bool operator> (
const integral_range_t<I>& a,
const integral_range_t<I>& b);
114template <
typename I>
bool operator<=(
const integral_range_t<I>& a,
const integral_range_t<I>& b);
115template <
typename I>
bool operator>=(
const integral_range_t<I>& a,
const integral_range_t<I>& b);
117template <
typename integral_type>
118class integral_range_t
122 typedef integral_range_t<integral_type> self_type;
124 typedef const_integral_iterator<integral_type> const_iterator;
125 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
127 typedef typename const_iterator::value_type value_type;
128 typedef typename const_iterator::pointer const_pointer;
129 typedef typename const_iterator::reference const_reference;
130 typedef typename const_iterator::difference_type difference_type;
131 typedef std::size_t size_type;
134 integral_range_t(value_type last);
135 integral_range_t(value_type first, value_type last);
136 integral_range_t(value_type first, value_type last, value_type step);
138 const_iterator begin()
const;
139 const_iterator end()
const;
140 const_reverse_iterator rbegin()
const;
141 const_reverse_iterator rend()
const;
143 const_pointer operator->()
const;
144 const_reference operator*()
const;
145 value_type operator[](difference_type index)
const;
147 self_type& operator++();
148 self_type operator++(
int);
149 self_type& operator--();
150 self_type operator--(
int);
152 self_type& operator+=(difference_type n);
153 self_type& operator-=(difference_type n);
154 self_type operator+(difference_type n)
const;
155 self_type operator-(difference_type n)
const;
157 const size_type size()
const;
158 const bool empty()
const;
159 const bool operator!()
const;
160 explicit operator bool()
const;
162 void swap(self_type& other);
166 friend bool operator== <integral_type>(
const integral_range_t<integral_type>& a,
const integral_range_t<integral_type>& b);
167 friend bool operator< <integral_type>(
const integral_range_t<integral_type>& a,
const integral_range_t<integral_type>& b);
169 integral_type first_;
174template <
typename I> integral_range_t<I>
integral_range(
const I& last);
175template <
typename I> integral_range_t<I>
integral_range(
const I& first,
const I& last);
176template <
typename I> integral_range_t<I>
integral_range(
const I& first,
const I& last,
const I& step);
Library for Assembled Shared Sources.