Option++  2.0
C++ library for reading command-line options
Public Member Functions | List of all members
optionpp::result_iterator< T, Ptr, Ref, IsOption > Class Template Reference

Iterator over parser_result arguments. More...

#include <result_iterator.hpp>

Inheritance diagram for optionpp::result_iterator< T, Ptr, Ref, IsOption >:
Inheritance graph
[legend]
Collaboration diagram for optionpp::result_iterator< T, Ptr, Ref, IsOption >:
Collaboration graph
[legend]

Public Member Functions

 result_iterator () noexcept
 Default constructor.
 
 result_iterator (T &result)
 Constructor. More...
 
Ref operator* () const
 Dereference operator. More...
 
Ptr operator-> () const
 Member access operator. More...
 
result_iteratoroperator++ ()
 Prefix increment operator. More...
 
result_iterator operator++ (int)
 Postfix increment operator. More...
 
result_iteratoroperator-- ()
 Prefix decrement operator. More...
 
result_iterator operator-- (int)
 Postfix decrement operator. More...
 
bool operator== (const result_iterator< T, Ptr, Ref, IsOption > &other) const
 result_iterator comparison operator. More...
 
bool operator!= (const result_iterator< T, Ptr, Ref, IsOption > &other) const
 result_iterator comparison operator. More...
 

Detailed Description

template<typename T, typename Ptr, typename Ref, bool IsOption>
class optionpp::result_iterator< T, Ptr, Ref, IsOption >

Iterator over parser_result arguments.

Constructor & Destructor Documentation

◆ result_iterator()

template<typename T , typename Ptr , typename Ref , bool IsOption>
optionpp::result_iterator< T, Ptr, Ref, IsOption >::result_iterator ( T &  result)
inline

Constructor.

Parameters
resultParser result to iterate over.

Member Function Documentation

◆ operator!=()

template<typename T , typename Ptr , typename Ref , bool IsOption>
bool optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator!= ( const result_iterator< T, Ptr, Ref, IsOption > &  other) const
inline

result_iterator comparison operator.

Parameters
otherRight operand to compare.
Returns
False if both iterators point to the same member of the same parser_result.

◆ operator*()

template<typename T , typename Ptr , typename Ref , bool IsOption>
Ref optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator*

Dereference operator.

Exceptions
bad_dereferenceIf called on a default-constructed instance.
Returns
Reference to the pointed-to entry.

◆ operator++() [1/2]

template<typename T , typename Ptr , typename Ref , bool IsOption>
auto optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator++

Prefix increment operator.

Returns
The incremented iterator pointing to the next non-option argument.

◆ operator++() [2/2]

template<typename T , typename Ptr , typename Ref , bool IsOption>
result_iterator optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator++ ( int  )
inline

Postfix increment operator.

Returns
A copy of the unincremented iterator.

◆ operator--() [1/2]

template<typename T , typename Ptr , typename Ref , bool IsOption>
auto optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator--

Prefix decrement operator.

Exceptions
out_of_rangeIf the iterator already points to the beginning.
Returns
The decremented iterator pointing to the previous non-option argument.

◆ operator--() [2/2]

template<typename T , typename Ptr , typename Ref , bool IsOption>
result_iterator optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator-- ( int  )
inline

Postfix decrement operator.

Exceptions
out_of_rangeIf the iterator already points to the beginning.
Returns
A copy of the undecremented iterator.

◆ operator->()

template<typename T , typename Ptr , typename Ref , bool IsOption>
Ptr optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator-> ( ) const
inline

Member access operator.

Exceptions
bad_dereferenceIf called on a default-constructed instance or on end().
Returns
Reference to the pointed-to entry.

◆ operator==()

template<typename T , typename Ptr , typename Ref , bool IsOption>
bool optionpp::result_iterator< T, Ptr, Ref, IsOption >::operator== ( const result_iterator< T, Ptr, Ref, IsOption > &  other) const

result_iterator comparison operator.

Parameters
otherRight operand to compare.
Returns
True if both iterators point to the same member of the parser_result.

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