Files
fennec/include/fennec/lang/detail/_numeric_transforms.h
2026-01-06 19:48:28 -05:00

60 lines
2.9 KiB
C++

// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 - 2026 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
#ifndef FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
#define FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
#include <fennec/lang/types.h>
#include <fennec/lang/type_transforms.h>
namespace fennec::detail
{
template<typename> struct _make_unsigned : type_identity<undefined_t> {};
template<> struct _make_unsigned<char_t> : type_identity<uchar_t> {};
template<> struct _make_unsigned<uchar_t> : type_identity<uchar_t> {};
template<> struct _make_unsigned<schar_t> : type_identity<uchar_t> {};
template<> struct _make_unsigned<short_t> : type_identity<ushort_t> {};
template<> struct _make_unsigned<ushort_t> : type_identity<ushort_t> {};
template<> struct _make_unsigned<uint_t> : type_identity<uint_t> {};
template<> struct _make_unsigned<int_t> : type_identity<uint_t> {};
template<> struct _make_unsigned<long_t> : type_identity<ulong_t> {};
template<> struct _make_unsigned<ulong_t> : type_identity<ulong_t> {};
template<> struct _make_unsigned<llong_t> : type_identity<ullong_t> {};
template<> struct _make_unsigned<ullong_t> : type_identity<ullong_t> {};
template<typename> struct _make_signed : type_identity<undefined_t> {};
template<> struct _make_signed<char_t> : type_identity<schar_t> {};
template<> struct _make_signed<uchar_t> : type_identity<schar_t> {};
template<> struct _make_signed<schar_t> : type_identity<schar_t> {};
template<> struct _make_signed<short_t> : type_identity<short_t> {};
template<> struct _make_signed<ushort_t> : type_identity<short_t> {};
template<> struct _make_signed<uint_t> : type_identity<int_t> {};
template<> struct _make_signed<int_t> : type_identity<int_t> {};
template<> struct _make_signed<long_t> : type_identity<long_t> {};
template<> struct _make_signed<ulong_t> : type_identity<long_t> {};
template<> struct _make_signed<llong_t> : type_identity<llong_t> {};
template<> struct _make_signed<ullong_t> : type_identity<llong_t> {};
}
#endif // FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H