From ee298f18b866ba93f8b480ae07632ce5a84ea280 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 13 Jan 2018 22:15:07 +0000 Subject: [PATCH] Add is_(un)signed to compat.h, with specializations for the Tracker classes. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@6577 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/compat.h | 10 ++++++++++ source/build/include/tracker.hpp | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/source/build/include/compat.h b/source/build/include/compat.h index 081685490..bba12551f 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -687,6 +687,16 @@ void eduke32_exit_return(int) ATTRIBUTE((noreturn)); # if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800) using std::is_integral; +template +struct is_signed +{ + static constexpr bool value = std::is_signed::value; +}; +template +struct is_unsigned +{ + static constexpr bool value = std::is_unsigned::value; +}; # endif # if CXXSTD >= 2014 diff --git a/source/build/include/tracker.hpp b/source/build/include/tracker.hpp index 3b6c8f383..10080d003 100644 --- a/source/build/include/tracker.hpp +++ b/source/build/include/tracker.hpp @@ -90,3 +90,14 @@ inline TrackedType TRACKER_NAME_::cast() const { return this->TrackedValue; } + +template +struct is_signed> +{ + static constexpr bool value = std::is_signed::value; +}; +template +struct is_unsigned> +{ + static constexpr bool value = std::is_unsigned::value; +};