chsvlib
chsv helper source code

An auxiliary class for a range given by a pair of iterators. More...

#include <chsvmemex.h>

Inheritance diagram for iterator_range< Iterator >:
Collaboration diagram for iterator_range< Iterator >:

Public Types

typedef Iterator iterator
 A type of an underlying iterator.
 
typedef std::iterator_traits< Iterator >::value_type value_type
 A type of an element addressed by an iterator of the range.
 
typedef std::iterator_traits< Iterator >::pointer pointer
 A type of a pointer to an element addressed by an iterator of the range.
 
typedef std::iterator_traits< Iterator >::reference reference
 A type of a reference to an element addressed by an iterator of the range.
 
typedef std::iterator_traits< Iterator >::difference_type difference_type
 

Public Member Functions

 iterator_range ()=default
 A default constructor.
 
template<class RightIterator , class = typename std::enable_if<std::is_convertible<RightIterator, Iterator>::value>::type>
CONSTEXPR_CPP14 iterator_range (const iterator_range< RightIterator > &right) noexcept(std::is_nothrow_constructible< Iterator, const RightIterator & >::value)
 
template<class RightIterator , class = typename std::enable_if<std::is_convertible<RightIterator, Iterator>::value>::type>
CONSTEXPR_CPP14 iterator_range (iterator_range< RightIterator > &&right) noexcept(std::is_nothrow_constructible< Iterator, RightIterator && >::value)
 
template<class IteratorBegin , class IteratorEnd >
CONSTEXPR_CPP14 iterator_range (IteratorBegin &&begin_iterator, IteratorEnd &&end_iterator) noexcept(std::is_nothrow_constructible< Iterator, IteratorBegin && >::value &&std::is_nothrow_constructible< Iterator, IteratorEnd && >::value)
 
template<class IteratorBegin , class IteratorEnd >
CONSTEXPR_CPP14 iterator_range (const std::pair< IteratorBegin, IteratorEnd > &pr) noexcept(std::is_nothrow_constructible< Iterator, const IteratorBegin & >::value &&std::is_nothrow_constructible< Iterator, const IteratorEnd & >::value)
 Constructs a range from a pair of iterators. More...
 
template<class IteratorBegin , class IteratorEnd >
CONSTEXPR_CPP14 iterator_range (std::pair< IteratorBegin, IteratorEnd > &&pr) noexcept(std::is_nothrow_constructible< Iterator, IteratorBegin && >::value &&std::is_nothrow_constructible< Iterator, IteratorEnd && >::value)
 Constructs a range from a pair of iterators. More...
 
constexpr const iteratorbegin () const noexcept
 Returns the first iterator of the range. More...
 
constexpr const iteratorend () const noexcept
 Returns the past-the-end iterator of the range. More...
 
constexpr const iteratorcbegin () const noexcept
 Returns the first iterator of the range. More...
 
constexpr const iteratorcend () const noexcept
 Returns the past-the-end iterator of the range. More...
 
CONSTEXPR_CPP17 difference_type size () const
 Returns the length of the current range. More...
 
constexpr bool empty () const noexcept
 Checks whether the range is empty. More...
 

Detailed Description

template<class Iterator>
struct Chusov::Memory::iterator_range< Iterator >

An auxiliary class for a range given by a pair of iterators.

Template Parameters
Iteratoris a type of a managed iterator.

The class is implicitly convertible from std::pair of iterators that are implicitly convertible to Iterator, inherits publicly from std::pair of Iterator, and supports [std::tuple_size] (returning 2).

Hence, it can be assigned to a tuple and used to assign to the result of std::tie as well as in structured binding declarations of C++17.


The documentation for this struct was generated from the following file: