OpenTTD Source
20241108-master-g80f628063a
|
Type (helpers) for enums. More...
Go to the source code of this file.
Macros | |
#define | DECLARE_POSTFIX_INCREMENT(enum_type) |
Some enums need to have allowed incrementing (i.e. More... | |
#define | DECLARE_ENUM_AS_BIT_SET(enum_type) |
Operators to allow to work with enum as with type safe bit set in C++. More... | |
#define | DECLARE_ENUM_AS_ADDABLE(EnumType) |
Operator that allows this enumeration to be added to any other enumeration. More... | |
Functions | |
template<typename enum_type > | |
constexpr std::underlying_type_t< enum_type > | to_underlying (enum_type e) |
Implementation of std::to_underlying (from C++23) | |
template<typename T , class = typename std::enable_if_t<std::is_enum_v<T>>> | |
constexpr debug_inline bool | HasFlag (const T x, const T y) |
Checks if a value in a bitset enum is set. More... | |
Type (helpers) for enums.
Definition in file enum_type.hpp.
#define DECLARE_ENUM_AS_ADDABLE | ( | EnumType | ) |
Operator that allows this enumeration to be added to any other enumeration.
Definition at line 45 of file enum_type.hpp.
#define DECLARE_ENUM_AS_BIT_SET | ( | enum_type | ) |
Operators to allow to work with enum as with type safe bit set in C++.
Definition at line 35 of file enum_type.hpp.
#define DECLARE_POSTFIX_INCREMENT | ( | enum_type | ) |
Some enums need to have allowed incrementing (i.e.
StationClassID)
Definition at line 18 of file enum_type.hpp.
|
constexpr |
Checks if a value in a bitset enum is set.
x | The value to check. |
y | The flag to check. |
Definition at line 58 of file enum_type.hpp.
Referenced by AcceptEnginePreview(), CalcEngineReliability(), CalendarEnginesMonthlyLoop(), CmdSendVehicleToDepot(), GUIEngineListAddChildren(), NewVehicleAvailable(), and SetRailStationTileFlags().