Codechange: make no assumptions on how the internals of TileIndex work (#11183)

Basically, avoid ".value", and just cast it to its original type
if you want to retrieve this.
This commit is contained in:
Patric Stout
2023-08-11 14:53:51 +02:00
committed by GitHub
parent 6190f48df0
commit 5fba47b0f7
3 changed files with 5 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ public:
if constexpr (std::is_enum_v<T>) {
this->Write(static_cast<std::underlying_type_t<const T>>(data));
} else if constexpr (std::is_base_of_v<StrongTypedefBase, T>) {
this->Write(data.value);
this->Write(static_cast<typename T::Type>(data));
} else {
this->Write(data);
}
@@ -146,7 +146,7 @@ public:
if constexpr (std::is_enum_v<T>) {
data = static_cast<T>(this->Read<std::underlying_type_t<T>>());
} else if constexpr (std::is_base_of_v<StrongTypedefBase, T>) {
data.value = this->Read<decltype(data.value)>();
data = this->Read<typename T::Type>();
} else {
data = this->Read<T>();
}