4 #define GAUDI_RANGE_H 1
76 template <
class CONTAINER>
81 typedef std::pair<
typename CONTAINER::const_iterator,
82 typename CONTAINER::const_iterator>
Base ;
89 typedef typename Container::const_iterator
iterator ;
93 typedef typename Container::const_reference
reference ;
126 inline size_t size ()
const
147 inline Range_ slice(
long index1 ,
long index2 )
const
150 if (
empty() || index1 == index2 ) {
return Range_() ; }
152 if ( index1 < 0 ) { index1 += size () ; }
153 if ( index2 < 0 ) { index2 += size () ; }
155 if ( index1 < 0 ) {
return Range_ () ; }
156 if ( index2 < index1 ) {
return Range_ () ; }
158 if ( index1 > (
long) size () ) {
return Range_() ; }
159 if ( index2 > (
long) size () ) { index2 = size() ; }
166 return Range_( i1 , i2 ) ;
184 {
return (*
this)( index ) ; }
192 if ( index < 0 || index >= (
long) size () )
194 return (*
this) ( index );
203 ( begin () ,
end () , right.
begin () , right.
end () ) ;
209 ( begin () ,
end () , right.begin () , right.end () ) ;
217 if ( &right ==
this ) {
return true ; }
218 if ( right.
size () != size () ) {
return false ; }
224 if ( right.size () != size () ) {
return false ; }
236 operator const Base& ()
const {
return base () ; }
238 inline const Base&
base ()
const {
return m_base ; }
274 template <
class CONTAINER>
284 #endif // GAUDI_RANGE_H