1 #ifndef __window_array_hpp__
2 #define __window_array_hpp__
13 template <
typename Iterator>
17 typedef Iterator iterator_type;
18 typedef typename std::iterator_traits<Iterator>::reference reference;
22 ipair(Iterator i1, Iterator i2) : begin(i1), end(i2) {}
23 template<
typename T>
ipair(
const std::pair<T, T>& p) : begin(p.first), end(p.second) {};
24 template<
typename T>
ipair(
const ipair<T>& p) : begin(p.begin), end(p.end) {};
28 operator std::pair<Iterator, Iterator>() {
return std::make_pair(begin, end); }
32 reference operator[](
size_t ndx)
const { Iterator i=begin; std::advance(i, ndx);
return *i; }
33 size_t size()
const {
return std::distance(begin, end); }
34 bool empty()
const {
return begin==end; }
43 #endif // __window_array_hpp__
Definition: utility.hpp:14