Calico
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups
cal::iterator_range< InputIterator > Struct Template Reference

An container-like type defined by a pair of iterators. More...

#include <iterator.hpp>

+ Inheritance diagram for cal::iterator_range< InputIterator >:

Public Types

typedef InputIterator const_iterator
 Const iterator type.
 
typedef std::iterator_traits
< const_iterator >::pointer 
const_pointer
 Const pointer type.
 
typedef std::iterator_traits
< const_iterator >::reference 
const_reference
 Const reference type.
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 Const reverse iterator.
 
typedef std::common_type
< std::iterator_traits
< const_iterator >
::difference_type,
std::iterator_traits< iterator >
::difference_type >::type 
difference_type
 Difference type.
 
typedef InputIterator iterator
 Iterator type.
 
typedef std::iterator_traits
< iterator >::pointer 
pointer
 Pointer type.
 
typedef std::iterator_traits
< iterator >::reference 
reference
 Reference type.
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 Reverse iterator.
 
typedef auto size_type
 Size type.
 
typedef std::common_type
< std::iterator_traits
< const_iterator >::value_type,
std::iterator_traits< iterator >
::value_type >::type 
value_type
 Value type.
 

Public Member Functions

const_reference at (size_type index) const
 Accesses the element at a given index with bounds-checking. More...
 
reference at (size_type index)
 Accesses the element at a given index with bounds-checking. More...
 
const_reference back () const
 Returns a const_reference to the last element in the container. More...
 
reference back ()
 Returns a reference to the last element in the container. More...
 
iterator begin ()
 Returns an iterator to the beginning of the container. More...
 
const_iterator cbegin () const
 Returns a const_iterator to the beginning of the container. More...
 
const_iterator cend () const
 Returns a const_iterator to the end of the container. More...
 
const_reverse_iterator crbegin () const
 Returns a const_reverse_iterator to the beginning of the container. More...
 
const_reverse_iterator crend () const
 Returns a const_reverse_iterator to the end of the container. More...
 
bool empty () const
 Returns whether the container is empty. More...
 
iterator end ()
 Returns an iterator to the end of the container. More...
 
const_reference front () const
 Returns a const_reference to the first element in the container. More...
 
reference front ()
 Returns a reference to the first element in the container. More...
 
const_reference operator[] (size_type index) const
 Accesses the element at a given index. More...
 
reference operator[] (size_type index)
 Accesses the element at a given index. More...
 
reverse_iterator rbegin ()
 Returns a const_reverse_iterator to the beginning of the container. More...
 
const_reverse_iterator rbegin () const
 Returns a const_reverse_iterator to the beginning of the container. More...
 
reverse_iterator rend ()
 Returns a const_reverse_iterator to the end of the container. More...
 
const_reverse_iterator rend () const
 Returns a const_reverse_iterator to the end of the container. More...
 
size_type size () const
 Returns the number of elements in the container. More...
 

Protected Member Functions

iterator _begin ()
 Returns an iterator to the beginning of the container. More...
 
iterator _end ()
 Returns an iterator to the end of the container. More...
 

Detailed Description

template<class InputIterator>
struct cal::iterator_range< InputIterator >

An container-like type defined by a pair of iterators.

Member Function Documentation

iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::_begin ( )
inlineprotectedinherited

Returns an iterator to the beginning of the container.

Depends on data(). This function is provided so that the non-const begin() can be overridden without shadowing the const begin() provided by this base type.

iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::_end ( )
inlineprotectedinherited

Returns an iterator to the end of the container.

Depends on begin() and size(). This function is provided so that the non-const end() can be overridden without shadowing the const end() provided by this base type.

const_reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::at ( size_type  index) const
inlineinherited

Accesses the element at a given index with bounds-checking.

Depends on operator[] const.

reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::at ( size_type  index)
inlineinherited

Accesses the element at a given index with bounds-checking.

Depends on operator[].

const_reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::back ( ) const
inlineinherited

Returns a const_reference to the last element in the container.

Depends on end() const and is only defined if the iterator is bidirectional. If the container is empty, the result is undefined.

reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::back ( )
inlineinherited

Returns a reference to the last element in the container.

Depends on end() and is only defined if the iterator is bidirectional. If the container is empty, the result is undefined.

iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::begin ( )
inlineinherited

Returns an iterator to the beginning of the container.

Depends on _begin().

const_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::cbegin ( ) const
inlineinherited

Returns a const_iterator to the beginning of the container.

Depends on begin() const.

const_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::cend ( ) const
inlineinherited

Returns a const_iterator to the end of the container.

Depends on end() const.

const_reverse_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::crbegin ( ) const
inlineinherited

Returns a const_reverse_iterator to the beginning of the container.

Depends on rbegin() const.

const_reverse_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::crend ( ) const
inlineinherited

Returns a const_reverse_iterator to the end of the container.

Depends on rend() const.

bool cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::empty ( ) const
inlineinherited

Returns whether the container is empty.

Depends on begin() const and end() const.

iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::end ( )
inlineinherited

Returns an iterator to the end of the container.

Depends on _end().

const_reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::front ( ) const
inlineinherited

Returns a const_reference to the first element in the container.

Depends on begin() const. If the container is empty, the result is undefined.

reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::front ( )
inlineinherited

Returns a reference to the first element in the container.

Depends on begin(). If the container is empty, the result is undefined.

const_reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::operator[] ( size_type  index) const
inlineinherited

Accesses the element at a given index.

Depends on begin() const and calls std::advance with ADL.

reference cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::operator[] ( size_type  index)
inlineinherited

Accesses the element at a given index.

Depends on begin() and calls std::advance with ADL.

reverse_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::rbegin ( )
inlineinherited

Returns a const_reverse_iterator to the beginning of the container.

Depends on end().

const_reverse_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::rbegin ( ) const
inlineinherited

Returns a const_reverse_iterator to the beginning of the container.

Depends on end() const.

reverse_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::rend ( )
inlineinherited

Returns a const_reverse_iterator to the end of the container.

Depends on begin().

const_reverse_iterator cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::rend ( ) const
inlineinherited

Returns a const_reverse_iterator to the end of the container.

Depends on begin() const.

size_type cal::container_base< iterator_range< InputIterator > , InputIterator , InputIterator , auto >::size ( ) const
inlineinherited

Returns the number of elements in the container.

Depends on begin() const and end() const and calls std::distance() with ADL.