corelib/include/ebcl/bits/ArrayIteratorDecl.hh

32 lines
701 B
C++
Raw Normal View History

#ifndef M_TGT_
# define M_TGT_ T_Self
#endif
template< ptrdiff_t Direction >
class T_Iterator_ final : public std::iterator<
std::random_access_iterator_tag , Type >
{
private:
M_TGT_* array_;
ptrdiff_t pos_;
public:
T_Iterator_( M_TGT_& array ,
const ptrdiff_t pos ) noexcept;
M_ITER_CONS_DEF( T_Iterator_ );
M_ITER_CONS_COPY( T_Iterator_ );
M_ITER_SWAP( T_Iterator_ );
M_ITER_CMP_ALL( T_Iterator_ );
M_ITER_DEREF_RANDOM( Type& , Type* );
M_ITER_OPS_RANDOM( T_Iterator_ );
bool valid( ) const noexcept;
M_TGT_* target( ) const noexcept;
ptrdiff_t pos( ) const noexcept;
};
using T_Iterator = T_Iterator_< 1 >;
using T_ReverseIterator = T_Iterator_< -1 >;
#undef M_TGT_