|
OpenTTD Source 20260218-master-g2123fca5ea
|
A sort-of mixin that implements 'at(pos)' and 'operator[](pos)' only for a specific enum class. More...
#include <enum_type.hpp>
Public Member Functions | |
| Container::reference | at (size_t pos) |
| Container::reference | at (const Index &pos) |
| Container::const_reference | at (size_t pos) const |
| Container::const_reference | at (const Index &pos) const |
| Container::reference | operator[] (size_t pos) |
| Container::reference | operator[] (const Index &pos) |
| Container::const_reference | operator[] (size_t pos) const |
| Container::const_reference | operator[] (const Index &pos) const |
A sort-of mixin that implements 'at(pos)' and 'operator[](pos)' only for a specific enum class.
This to prevent having to call 'to_underlying()' for many container accesses, whilst preventing accidental use of the wrong index type.
| Container | A base container. |
| Index | The enum class to use for indexing. |
Definition at line 247 of file enum_type.hpp.
|
inline |
Definition at line 250 of file enum_type.hpp.
|
inline |
Definition at line 253 of file enum_type.hpp.
|
inline |
Definition at line 249 of file enum_type.hpp.
|
inline |
Definition at line 252 of file enum_type.hpp.
|
inline |
Definition at line 256 of file enum_type.hpp.
|
inline |
Definition at line 259 of file enum_type.hpp.
|
inline |
Definition at line 255 of file enum_type.hpp.
|
inline |
Definition at line 258 of file enum_type.hpp.