OpenTTD Source 20250205-master-gfd85ab1e2c
|
Templated helper to make a type-safe 'typedef' representing a single POD value. More...
#include <strong_typedef_type.hpp>
Public Types | |
using | BaseType = TBaseType |
Public Member Functions | |
constexpr | Typedef (const Typedef &)=default |
constexpr | Typedef (Typedef &&)=default |
constexpr | Typedef (const TBaseType &value) |
constexpr Typedef & | operator= (const Typedef &rhs) |
constexpr Typedef & | operator= (Typedef &&rhs) |
constexpr TBaseType | base () const noexcept |
Data Fields | |
TBaseType | value {} |
Friends | |
struct | Compare |
struct | Integer |
template<typename TCompatibleType > | |
struct | Compatible |
GRF file does not exactly match the requested GRF (different MD5SUM), but grfid matches) | |
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.
Example usage:
using MyType = StrongType::Typedef<int, struct MyTypeTag, StrongType::Explicit, StrongType::Compare, StrongType::Integer>;
TBaseType | Type of the derived class (i.e. the concrete usage of this class). |
TTag | An unique struct to keep types of the same TBaseType distinct. |
TProperties | A list of mixins to add to the class. |
Definition at line 147 of file strong_typedef_type.hpp.
using StrongType::Typedef< TBaseType, TTag, TProperties >::BaseType = TBaseType |
Definition at line 148 of file strong_typedef_type.hpp.
|
inlineexplicitconstexpr |
Definition at line 154 of file strong_typedef_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 160 of file strong_typedef_type.hpp.
|
inlineconstexpr |
Definition at line 156 of file strong_typedef_type.hpp.
|
inlineconstexpr |
Definition at line 157 of file strong_typedef_type.hpp.
|
friend |
Definition at line 163 of file strong_typedef_type.hpp.
|
friend |
GRF file does not exactly match the requested GRF (different MD5SUM), but grfid matches)
Definition at line 165 of file strong_typedef_type.hpp.
|
friend |
Definition at line 164 of file strong_typedef_type.hpp.
TBaseType StrongType::Typedef< TBaseType, TTag, TProperties >::value {} |
Definition at line 174 of file strong_typedef_type.hpp.