|
OpenTTD Source
13.2.1
|
Templated helper to make a type-safe 'typedef' representing a single POD value. More...
#include <strong_typedef_type.hpp>
Public Types | |
| using | Type = T |
Public Member Functions | |
| constexpr | StrongTypedef (const StrongTypedef &o)=default |
| constexpr | StrongTypedef (StrongTypedef &&o)=default |
| constexpr | StrongTypedef (const T &value) |
| constexpr Tthis & | operator= (const StrongTypedef &rhs) |
| constexpr Tthis & | operator= (StrongTypedef &&rhs) |
| constexpr Tthis & | operator= (const T &rhs) |
| constexpr | operator T () const |
| constexpr bool | operator== (const StrongTypedef &rhs) const |
| constexpr bool | operator!= (const StrongTypedef &rhs) const |
| constexpr bool | operator== (const T &rhs) const |
| constexpr bool | operator!= (const T &rhs) const |
Data Fields | |
| T | value {} |
| Backing storage field. | |
Templated helper to make a type-safe 'typedef' representing a single POD value.
A normal 'typedef' is not distinct from its base type and will be treated as identical in many contexts. This class provides a distinct type that can still be assign from and compared to values of its base type.
| T | Storage type |
| Tthis | Type of the derived class (i.e. the concrete usage of this class). |
Definition at line 27 of file strong_typedef_type.hpp.