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
This commit is contained in:
hendricks266 2018-01-13 22:15:07 +00:00
parent 0ece42110c
commit ee298f18b8
2 changed files with 21 additions and 0 deletions

View file

@ -687,6 +687,16 @@ void eduke32_exit_return(int) ATTRIBUTE((noreturn));
# if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800)
using std::is_integral;
template <typename T>
struct is_signed
{
static constexpr bool value = std::is_signed<T>::value;
};
template <typename T>
struct is_unsigned
{
static constexpr bool value = std::is_unsigned<T>::value;
};
# endif
# if CXXSTD >= 2014

View file

@ -90,3 +90,14 @@ inline TrackedType TRACKER_NAME_<TrackedType>::cast() const
{
return this->TrackedValue;
}
template <typename TrackedType>
struct is_signed<TRACKER_NAME_<TrackedType>>
{
static constexpr bool value = std::is_signed<TrackedType>::value;
};
template <typename TrackedType>
struct is_unsigned<TRACKER_NAME_<TrackedType>>
{
static constexpr bool value = std::is_unsigned<TrackedType>::value;
};