mirror of https://github.com/OpenRCT2/OpenRCT2.git
Close #12223: Assert that Formatter::Add() only receives desired types
This commit is contained in:
parent
e99f4a23c5
commit
0272777d13
|
@ -131,6 +131,23 @@ public:
|
|||
{
|
||||
static_assert(sizeof(TSpecified) <= sizeof(uintptr_t), "Type too large");
|
||||
static_assert(sizeof(TDeduced) <= sizeof(uintptr_t), "Type too large");
|
||||
|
||||
// clang-format off
|
||||
static_assert(
|
||||
std::is_same_v<TSpecified, char*> ||
|
||||
std::is_same_v<TSpecified, const char*> ||
|
||||
std::is_same_v<TSpecified, int16_t> ||
|
||||
std::is_same_v<TSpecified, int32_t> ||
|
||||
std::is_same_v<TSpecified, money32> ||
|
||||
std::is_same_v<TSpecified, rct_string_id> ||
|
||||
std::is_same_v<TSpecified, uint8_t*> ||
|
||||
std::is_same_v<TSpecified, uint16_t> ||
|
||||
std::is_same_v<TSpecified, uint32_t> ||
|
||||
std::is_same_v<TSpecified, utf8*> ||
|
||||
std::is_same_v<TSpecified, const utf8*>
|
||||
);
|
||||
// clang-format on
|
||||
|
||||
uintptr_t convertedValue;
|
||||
if constexpr (std::is_integral_v<TSpecified>)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue