You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the game simply uses uint32_t for whenever it stores game ticks which is prone for errors when mixing it with other types, one of the examples can be seen in #21394.
It would be best to create a strong type so that we can no longer mix this up, I'm thinking about using a struct which offers a few helper functions while adhering std::is_trivially_constructible and std::is_pod so we can treat it more or less as a primitive.
while adhering std::is_trivially_constructible and std::is_pod
Nitpick: for the sake of future migration to C++20, best not to use std::is_pod (if you want to make it a static assert or something). I think what you want here is std::is_standard_layout.
while adhering std::is_trivially_constructible and std::is_pod
Nitpick: for the sake of future migration to C++20, best not to use std::is_pod (if you want to make it a static assert or something). I think what you want here is std::is_standard_layout.
Yeah, just saying it should act the same as any other primitive.
At the moment the game simply uses uint32_t for whenever it stores game ticks which is prone for errors when mixing it with other types, one of the examples can be seen in #21394.
It would be best to create a strong type so that we can no longer mix this up, I'm thinking about using a struct which offers a few helper functions while adhering
std::is_trivially_constructible
andstd::is_pod
so we can treat it more or less as a primitive.The text was updated successfully, but these errors were encountered: