forked from boostorg/range
added operator() to allow random access index with transform iterators
[SVN r40375]
This commit is contained in:
@ -348,10 +348,21 @@ namespace boost
|
|||||||
return *--last;
|
return *--last;
|
||||||
}
|
}
|
||||||
|
|
||||||
reference operator[]( size_type sz ) const
|
reference operator[]( size_type at ) const
|
||||||
{
|
{
|
||||||
BOOST_ASSERT( sz < size() );
|
BOOST_ASSERT( at < size() );
|
||||||
return m_Begin[sz];
|
return m_Begin[at];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// When storing transform iterators, operator[]()
|
||||||
|
// fails because it returns by reference. Therefore
|
||||||
|
// operator()() is provided for these cases.
|
||||||
|
//
|
||||||
|
value_type operator()( size_type at ) const
|
||||||
|
{
|
||||||
|
BOOST_ASSERT( at < size() );
|
||||||
|
return m_Begin[at];
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator_range& advance_begin( difference_type n )
|
iterator_range& advance_begin( difference_type n )
|
||||||
|
Reference in New Issue
Block a user