From e583cade278f6bbe5e1d069237815b251e7399db Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 9 Mar 2021 19:35:02 -0600 Subject: [PATCH] [ox/std] Add ResizedInt to get the same sign int with a different size --- deps/ox/src/ox/std/types.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/deps/ox/src/ox/std/types.hpp b/deps/ox/src/ox/std/types.hpp index e9d8d897..d182429e 100644 --- a/deps/ox/src/ox/std/types.hpp +++ b/deps/ox/src/ox/std/types.hpp @@ -128,6 +128,24 @@ using Signed = Int; template using Unsigned = Uint; +// ResizedInt retains the sign while granting a new size +template +struct ResizedInt { +}; + +template +struct ResizedInt { + using type = typename SignedType::type; +}; + +template +struct ResizedInt { + using type = typename UnsignedType::type; +}; + +template +using ResizedInt_t = typename ResizedInt::type; + }