Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::iterator_range< IteratorT > Class Template Reference

#include <range.h>

Public Types

using iterator = IteratorT
 
using const_iterator = IteratorT
 
using value_type = typename std::iterator_traits<IteratorT>::value_type
 

Public Member Functions

 iterator_range ()
 
 iterator_range (IteratorT begin_iterator, IteratorT end_iterator)
 
IteratorT begin () const
 
IteratorT end () const
 
template<class It = IteratorT>
std::enable_if< std::is_base_of< std::random_access_iterator_tag, typenamestd::iterator_traits< It >::iterator_category >::value, size_t >::type size () const
 
bool empty () const
 

Detailed Description

template<typename IteratorT>
class operations_research::math_opt::iterator_range< IteratorT >

A range adaptor for a pair of iterators.

This just wraps two iterators into a range-compatible interface. Nothing fancy at all.

Definition at line 29 of file range.h.

Member Typedef Documentation

◆ const_iterator

template<typename IteratorT >
using operations_research::math_opt::iterator_range< IteratorT >::const_iterator = IteratorT

Definition at line 32 of file range.h.

◆ iterator

template<typename IteratorT >
using operations_research::math_opt::iterator_range< IteratorT >::iterator = IteratorT

Definition at line 31 of file range.h.

◆ value_type

template<typename IteratorT >
using operations_research::math_opt::iterator_range< IteratorT >::value_type = typename std::iterator_traits<IteratorT>::value_type

Definition at line 33 of file range.h.

Constructor & Destructor Documentation

◆ iterator_range() [1/2]

template<typename IteratorT >
operations_research::math_opt::iterator_range< IteratorT >::iterator_range ( )
inline

Definition at line 35 of file range.h.

◆ iterator_range() [2/2]

template<typename IteratorT >
operations_research::math_opt::iterator_range< IteratorT >::iterator_range ( IteratorT begin_iterator,
IteratorT end_iterator )
inline

Definition at line 36 of file range.h.

Member Function Documentation

◆ begin()

template<typename IteratorT >
IteratorT operations_research::math_opt::iterator_range< IteratorT >::begin ( ) const
inline

Definition at line 40 of file range.h.

◆ empty()

template<typename IteratorT >
bool operations_research::math_opt::iterator_range< IteratorT >::empty ( ) const
inline

Returns true if this iterator range refers to an empty sequence, and false otherwise.

Definition at line 59 of file range.h.

◆ end()

template<typename IteratorT >
IteratorT operations_research::math_opt::iterator_range< IteratorT >::end ( ) const
inline

Definition at line 41 of file range.h.

◆ size()

template<typename IteratorT >
template<class It = IteratorT>
std::enable_if< std::is_base_of< std::random_access_iterator_tag, typenamestd::iterator_traits< It >::iterator_category >::value, size_t >::type operations_research::math_opt::iterator_range< IteratorT >::size ( ) const
inline

Returns the size of the wrapped range. Does not participate in overload resolution for non-random-access iterators, since in those cases this is a slow operation (it must walk the entire range and maintain a count).

Users who need to know the "size" of a non-random-access iterator_range should pass the range to absl::c_distance() instead.

Definition at line 54 of file range.h.


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