corelib/include/ebcl/bits/ArrayIteratorMethods.hh

79 lines
1.8 KiB
C++

#ifndef M_TMPL_
# error M_TMPL_ not defined
#endif
#ifndef M_TGT_
# error M_TGT_ not defined
#endif
#define M_HDR_ template< M_TMPL_ >
#define M_ITER_( NAME ) typename M_TGT_::T_ ##NAME
/*----------------------------------------------------------------------------*/
M_HDR_ inline M_ITER_( ConstIterator ) M_TGT_::begin( ) const noexcept
{
return T_ConstIterator( *this , 0 );
}
M_HDR_ inline M_ITER_( ConstIterator ) M_TGT_::end( ) const noexcept
{
return T_ConstIterator( *this , size( ) );
}
M_HDR_ inline M_ITER_( Iterator ) M_TGT_::begin( ) noexcept
{
return T_Iterator( *this , 0 );
}
M_HDR_ inline M_ITER_( Iterator ) M_TGT_::end( ) noexcept
{
return T_Iterator( *this , size( ) );
}
M_HDR_ inline M_ITER_( ConstReverseIterator ) M_TGT_::rbegin( ) const noexcept
{
return T_ConstReverseIterator( *this , 0 );
}
M_HDR_ inline M_ITER_( ConstReverseIterator ) M_TGT_::rend( ) const noexcept
{
return T_ConstReverseIterator( *this , size( ) );
}
M_HDR_ inline M_ITER_( ReverseIterator ) M_TGT_::rbegin( ) noexcept
{
return T_ReverseIterator( *this , size( ) - 1 );
}
M_HDR_ inline M_ITER_( ReverseIterator ) M_TGT_::rend( ) noexcept
{
return T_ReverseIterator( *this , -1 );
}
M_HDR_ inline M_ITER_( ConstIterator ) M_TGT_::cbegin( ) const noexcept
{
return T_ConstIterator( *this , 0 );
}
M_HDR_ inline M_ITER_( ConstIterator ) M_TGT_::cend( ) const noexcept
{
return T_ConstIterator( *this , size( ) );
}
M_HDR_ inline M_ITER_( ConstReverseIterator ) M_TGT_::crbegin( ) const noexcept
{
return T_ConstReverseIterator( *this , 0 );
}
M_HDR_ inline M_ITER_( ConstReverseIterator ) M_TGT_::crend( ) const noexcept
{
return T_ConstReverseIterator( *this , size( ) );
}
/*----------------------------------------------------------------------------*/
#undef M_ITER_
#undef M_HDR_
#undef M_TMPL_
#undef M_TGT_