OpenTTD Source 20250220-master-gf89924a727
ReferenceThroughBaseContainer< Container > Class Template Reference

A sort-of mixin that adds 'at(pos)' and 'operator[](pos)' implementations for 'ConvertibleThroughBase' types. More...

#include <convertible_through_base.hpp>

Inheritance diagram for ReferenceThroughBaseContainer< Container >:

Public Member Functions

Container::reference at (size_t pos)
 
Container::reference at (const ConvertibleThroughBase auto &pos)
 
Container::const_reference at (size_t pos) const
 
Container::const_reference at (const ConvertibleThroughBase auto &pos) const
 
Container::reference operator[] (size_t pos)
 
Container::reference operator[] (const ConvertibleThroughBase auto &pos)
 
Container::const_reference operator[] (size_t pos) const
 
Container::const_reference operator[] (const ConvertibleThroughBase auto &pos) const
 

Detailed Description

template<typename Container>
class ReferenceThroughBaseContainer< Container >

A sort-of mixin that adds 'at(pos)' and 'operator[](pos)' implementations for 'ConvertibleThroughBase' types.

This to prevent having to call '.base()' for many container accesses.

Definition at line 37 of file convertible_through_base.hpp.

Member Function Documentation

◆ at() [1/4]

template<typename Container >
Container::reference ReferenceThroughBaseContainer< Container >::at ( const ConvertibleThroughBase auto &  pos)
inline

Definition at line 40 of file convertible_through_base.hpp.

◆ at() [2/4]

template<typename Container >
Container::const_reference ReferenceThroughBaseContainer< Container >::at ( const ConvertibleThroughBase auto &  pos) const
inline

Definition at line 43 of file convertible_through_base.hpp.

◆ at() [3/4]

template<typename Container >
Container::reference ReferenceThroughBaseContainer< Container >::at ( size_t  pos)
inline

Definition at line 39 of file convertible_through_base.hpp.

◆ at() [4/4]

template<typename Container >
Container::const_reference ReferenceThroughBaseContainer< Container >::at ( size_t  pos) const
inline

Definition at line 42 of file convertible_through_base.hpp.

◆ operator[]() [1/4]

template<typename Container >
Container::reference ReferenceThroughBaseContainer< Container >::operator[] ( const ConvertibleThroughBase auto &  pos)
inline

Definition at line 46 of file convertible_through_base.hpp.

◆ operator[]() [2/4]

template<typename Container >
Container::const_reference ReferenceThroughBaseContainer< Container >::operator[] ( const ConvertibleThroughBase auto &  pos) const
inline

Definition at line 49 of file convertible_through_base.hpp.

◆ operator[]() [3/4]

template<typename Container >
Container::reference ReferenceThroughBaseContainer< Container >::operator[] ( size_t  pos)
inline

Definition at line 45 of file convertible_through_base.hpp.

◆ operator[]() [4/4]

template<typename Container >
Container::const_reference ReferenceThroughBaseContainer< Container >::operator[] ( size_t  pos) const
inline

Definition at line 48 of file convertible_through_base.hpp.


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