summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Globals.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 02b007e09..e6fde373e 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -390,6 +390,13 @@ using cTickTimeLong = std::chrono::duration<Int64, cTickTime::period>;
#error TOLUA_EXPOSITION should never actually be defined
#endif
+template <typename T>
+auto ToUnsigned(T a_Val)
+{
+ ASSERT(a_Val >= 0);
+ return static_cast<std::make_unsigned_t<T>>(a_Val);
+}
+