OGS
BaseLib::Range< Iterator > Class Template Reference

Detailed Description

template<typename Iterator>
class BaseLib::Range< Iterator >

Wraps a pair of iterators for use as a range in range-based for-loops.

Definition at line 48 of file ConfigTree.h.

#include <ConfigTree-impl.h>

Public Member Functions

 Range (Iterator begin, Iterator end)
 
Iterator begin () const
 
Iterator end () const
 
std::size_t size () const
 
bool empty () const
 

Private Attributes

Iterator begin_
 
Iterator end_
 

Constructor & Destructor Documentation

◆ Range()

template<typename Iterator >
BaseLib::Range< Iterator >::Range ( Iterator begin,
Iterator end )
inlineexplicit

Definition at line 25 of file ConfigTree-impl.h.

26 : begin_(std::move(begin)), end_(std::move(end))
27 {
28 }
Iterator end() const
Iterator begin() const

Member Function Documentation

◆ begin()

template<typename Iterator >
Iterator BaseLib::Range< Iterator >::begin ( ) const
inline

Definition at line 30 of file ConfigTree-impl.h.

30{ return begin_; }

References BaseLib::Range< Iterator >::begin_.

◆ empty()

template<typename Iterator >
bool BaseLib::Range< Iterator >::empty ( ) const
inline

Definition at line 33 of file ConfigTree-impl.h.

33{ return size() == 0; }
std::size_t size() const

References BaseLib::Range< Iterator >::size().

◆ end()

template<typename Iterator >
Iterator BaseLib::Range< Iterator >::end ( ) const
inline

Definition at line 31 of file ConfigTree-impl.h.

31{ return end_; }

References BaseLib::Range< Iterator >::end_.

◆ size()

template<typename Iterator >
std::size_t BaseLib::Range< Iterator >::size ( ) const
inline

Definition at line 32 of file ConfigTree-impl.h.

32{ return std::distance(begin_, end_); }

References BaseLib::Range< Iterator >::begin_, and BaseLib::Range< Iterator >::end_.

Referenced by BaseLib::Range< Iterator >::empty().

Member Data Documentation

◆ begin_

template<typename Iterator >
Iterator BaseLib::Range< Iterator >::begin_
private

◆ end_

template<typename Iterator >
Iterator BaseLib::Range< Iterator >::end_
private

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