1 #ifndef TIL_BASIC_ITERATOR_H 2 #define TIL_BASIC_ITERATOR_H 8 #include "boost/type_traits.hpp" 21 template <
typename T >
22 class basic_iterator :
public std::iterator<std::random_access_iterator_tag, T>
25 typedef std::iterator<std::random_access_iterator_tag, T>
Base;
29 typedef typename boost::remove_const<typename Base::value_type>::type
value_type;
33 template <
typename X >
41 operator T* () {
return m_pointer; }
44 template <
typename T1,
typename T2 >
46 template <
typename T1,
typename T2 >
55 template <
typename T1,
typename T2 >
60 return i1.m_pointer == i2.m_pointer;
63 template <
typename T1,
typename T2 >
68 return i1.m_pointer != i2.m_pointer;
Belongs to package Box Do not include directly, include til/Box.h instead.
friend bool operator!=(const basic_iterator< T1 > &i1, const basic_iterator< T2 > &i2)
friend bool operator==(const basic_iterator< T1 > &i1, const basic_iterator< T2 > &i2)
General macros, definitions and functions.
A simple wrapper around T*.
std::iterator< std::random_access_iterator_tag, T > Base
basic_iterator(basic_iterator< X > i)
boost::remove_const< typename Base::value_type >::type value_type