PCL
pcl::ReverseIterable< C > Class Template Reference

Reverse container adaptor. More...

#include <Iterator.h>

Public Member Functions

auto Begin ()
 
auto Begin () const
 
auto begin ()
 
auto begin () const
 
auto ConstBegin () const
 
auto ConstEnd () const
 
auto ConstReverseBegin () const
 
auto ConstReverseEnd () const
 
auto End ()
 
auto End () const
 
auto end ()
 
auto end () const
 
auto ReverseBegin ()
 
auto ReverseBegin () const
 
auto ReverseEnd ()
 
auto ReverseEnd () const
 

Detailed Description

template<class C>
class pcl::ReverseIterable< C >

A utility template class to facilitate the use of ranged-based for loops with reverse container iteration. Example of use:

Array<int> A{ 1, 2, 3, 4, 5 };
for ( auto a : A )
cout << a << ' ';
cout << '\n';
for ( auto a : ReverseIterable( A ) )
cout << a << ' ';
cout << '\n';

The output is:

1 2 3 4 5
5 4 3 2 1

Note
This class requires a compiler with C++14 support. In addition, the above example assumes a compiler with support for class template argument deduction, which is a C++17 feature.

Definition at line 546 of file Iterator.h.

Member Function Documentation

◆ Begin() [1/2]

template<class C >
auto pcl::ReverseIterable< C >::Begin ( )
inline

Returns a mutable reverse iterator located at the reverse beginning of the iterated container.

The reverse beginning corresponds to the last element in the container.

Definition at line 564 of file Iterator.h.

◆ Begin() [2/2]

template<class C >
auto pcl::ReverseIterable< C >::Begin ( ) const
inline

Returns an immutable reverse iterator located at the reverse beginning of the iterated container.

The reverse beginning corresponds to the last element in the container.

Definition at line 575 of file Iterator.h.

◆ begin() [1/2]

template<class C >
auto pcl::ReverseIterable< C >::begin ( )
inline

STL-compatible iteration. Equivalent to Begin().

Definition at line 684 of file Iterator.h.

◆ begin() [2/2]

template<class C >
auto pcl::ReverseIterable< C >::begin ( ) const
inline

STL-compatible iteration. Equivalent to Begin() const.

Definition at line 692 of file Iterator.h.

◆ ConstBegin()

template<class C >
auto pcl::ReverseIterable< C >::ConstBegin ( ) const
inline

Returns an immutable reverse iterator located at the reverse beginning of the iterated container.

The reverse beginning corresponds to the last element in the container.

Definition at line 586 of file Iterator.h.

◆ ConstEnd()

template<class C >
auto pcl::ReverseIterable< C >::ConstEnd ( ) const
inline

Returns an immutable reverse iterator located at the reverse end of the iterated container.

The reverse end corresponds to a nonexistent element immediately before the first element in the container.

Definition at line 622 of file Iterator.h.

◆ ConstReverseBegin()

template<class C >
auto pcl::ReverseIterable< C >::ConstReverseBegin ( ) const
inline

Returns an immutable iterator located at the beginning of the iterated container.

Definition at line 649 of file Iterator.h.

◆ ConstReverseEnd()

template<class C >
auto pcl::ReverseIterable< C >::ConstReverseEnd ( ) const
inline

Returns an immutable iterator located at the end of the iterated container.

Definition at line 675 of file Iterator.h.

◆ End() [1/2]

template<class C >
auto pcl::ReverseIterable< C >::End ( )
inline

Returns a mutable reverse iterator located at the reverse end of the iterated container.

The reverse end corresponds to a nonexistent element immediately before the first element in the container.

Definition at line 598 of file Iterator.h.

◆ End() [2/2]

template<class C >
auto pcl::ReverseIterable< C >::End ( ) const
inline

Returns an immutable reverse iterator located at the reverse end of the iterated container.

The reverse end corresponds to a nonexistent element immediately before the first element in the container.

Definition at line 610 of file Iterator.h.

◆ end() [1/2]

template<class C >
auto pcl::ReverseIterable< C >::end ( )
inline

STL-compatible iteration. Equivalent to End().

Definition at line 700 of file Iterator.h.

◆ end() [2/2]

template<class C >
auto pcl::ReverseIterable< C >::end ( ) const
inline

STL-compatible iteration. Equivalent to End() const.

Definition at line 708 of file Iterator.h.

◆ ReverseBegin() [1/2]

template<class C >
auto pcl::ReverseIterable< C >::ReverseBegin ( )
inline

Returns a mutable iterator located at the beginning of the iterated container.

Definition at line 631 of file Iterator.h.

◆ ReverseBegin() [2/2]

template<class C >
auto pcl::ReverseIterable< C >::ReverseBegin ( ) const
inline

Returns an immutable iterator located at the beginning of the iterated container.

Definition at line 640 of file Iterator.h.

◆ ReverseEnd() [1/2]

template<class C >
auto pcl::ReverseIterable< C >::ReverseEnd ( )
inline

Returns a mutable iterator located at the end of the iterated container.

Definition at line 657 of file Iterator.h.

◆ ReverseEnd() [2/2]

template<class C >
auto pcl::ReverseIterable< C >::ReverseEnd ( ) const
inline

Returns an immutable iterator located at the end of the iterated container.

Definition at line 666 of file Iterator.h.


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