diff options
author | Peter Bell <peterbell10@live.co.uk> | 2020-05-09 17:51:54 +0200 |
---|---|---|
committer | peterbell10 <peterbell10@live.co.uk> | 2020-05-09 21:37:16 +0200 |
commit | 1123c95cf2efdcb23ff557b956d58538ca24aefe (patch) | |
tree | e8f39c2519ad06afc4f52d8fbc1d8fb334aeea42 /src/Globals.h | |
parent | Update submodules (#4727) (diff) | |
download | cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.gz cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.bz2 cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.lz cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.xz cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.zst cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Globals.h | 7 |
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); +} + |