Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::IterableContainerBase< T, Derived > Class Template Reference

#include <base_types.h>

Public Types

using value_type = typename std::decay_t<T>::value_type
using iterator_type = decltype(std::begin(std::declval<T>()))

Public Member Functions

auto begin ()
auto end ()
auto begin () const
auto end () const

Detailed Description

template<typename T, typename Derived>
class operations_research::IterableContainerBase< T, Derived >

A container that can be iterated over, but does not own the data. The container can be either const or non-const. The container can be either a std::vector, a absl::Span, an IndexRange, a StrongVector or a CompressedStrongVector. We use the Curiously-Recurring Template Pattern (CRTP) to avoid having to specify the type of the container in the derived class, and to not lose runtime performance because of virtual functions.

Definition at line 350 of file base_types.h.

Member Typedef Documentation

◆ iterator_type

template<typename T, typename Derived>
using operations_research::IterableContainerBase< T, Derived >::iterator_type = decltype(std::begin(std::declval<T>()))

Definition at line 353 of file base_types.h.

◆ value_type

template<typename T, typename Derived>
using operations_research::IterableContainerBase< T, Derived >::value_type = typename std::decay_t<T>::value_type

Definition at line 352 of file base_types.h.

Member Function Documentation

◆ begin() [1/2]

template<typename T, typename Derived>
auto operations_research::IterableContainerBase< T, Derived >::begin ( )
inline

Definition at line 355 of file base_types.h.

◆ begin() [2/2]

template<typename T, typename Derived>
auto operations_research::IterableContainerBase< T, Derived >::begin ( ) const
inline

Definition at line 357 of file base_types.h.

◆ end() [1/2]

template<typename T, typename Derived>
auto operations_research::IterableContainerBase< T, Derived >::end ( )
inline

Definition at line 356 of file base_types.h.

◆ end() [2/2]

template<typename T, typename Derived>
auto operations_research::IterableContainerBase< T, Derived >::end ( ) const
inline

Definition at line 358 of file base_types.h.


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