Turn ride_id_t into a strong type

This commit is contained in:
ZehMatt 2021-08-02 07:24:39 +03:00 committed by ζeh Matt
parent c81bd7fe22
commit 49bbc0f854
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 3 additions and 2 deletions

View File

@ -13,11 +13,12 @@
#include <cstdint>
#include <limits>
#include <type_traits>
using ride_id_t = uint16_t;
enum class ride_id_t : uint16_t;
struct Ride;
constexpr const ride_id_t RIDE_ID_NULL = std::numeric_limits<ride_id_t>::max();
constexpr const ride_id_t RIDE_ID_NULL = static_cast<ride_id_t>(std::numeric_limits<std::underlying_type_t<ride_id_t>>::max());
/**
* Couples a ride type and subtype together.