diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-21 21:12:08 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-21 21:12:08 +0200 |
commit | bf44ae4b57573a5d6c5a1da3d5ed1edca0c978e0 (patch) | |
tree | 7d149b7ec2bcc4d693dfb61390d645f04af95216 /compat | |
parent | df2073a5692c991e4fc43c926334983997d272af (diff) |
kill std::size_t operator"" uz()
Diffstat (limited to 'compat')
-rw-r--r-- | compat/literal-size-type.hpp | 32 | ||||
-rw-r--r-- | compat/prelude.hpp | 6 |
2 files changed, 3 insertions, 35 deletions
diff --git a/compat/literal-size-type.hpp b/compat/literal-size-type.hpp deleted file mode 100644 index a9034031..00000000 --- a/compat/literal-size-type.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -#if !(defined __cpp_size_t_suffix && __cpp_size_t_suffix >= 202006L) -#include <cstddef> -#include <type_traits> -#include <cstdlib> -#include <limits> - -namespace floormat { - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wuser-defined-literals" -#pragma clang diagnostic ignored "-Wtautological-type-limit-compare" -#elif defined _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4455) -#endif - -[[maybe_unused]] constexpr std::size_t operator"" zu(unsigned long long int x) noexcept { if constexpr (sizeof(decltype(x)) > sizeof(std::size_t)) if (x > std::numeric_limits<std::size_t>::max()) std::abort(); return std::size_t(x); } -[[maybe_unused]] constexpr std::size_t operator"" ZU(unsigned long long int x) noexcept { if constexpr (sizeof(decltype(x)) > sizeof(std::size_t)) if (x > std::numeric_limits<std::size_t>::max()) std::abort(); return std::size_t(x); } - -[[maybe_unused]] constexpr auto operator"" z(unsigned long long int x) noexcept { if constexpr (sizeof(decltype(x)) >= sizeof(std::size_t)) if (x > (std::size_t)std::numeric_limits<std::make_signed_t<std::size_t>>::max()) std::abort(); return std::make_signed_t<std::size_t>(x); } -[[maybe_unused]] constexpr auto operator"" Z(unsigned long long int x) noexcept { if constexpr (sizeof(decltype(x)) >= sizeof(std::size_t)) if (x > (std::size_t)std::numeric_limits<std::make_signed_t<std::size_t>>::max()) std::abort(); return std::make_signed_t<std::size_t>(x); } - -#ifdef __clang__ -#pragma clang diagnostic pop -#elif defined _MSC_VER -#pragma warning(pop) -#endif - -} // namespace floormat -#endif diff --git a/compat/prelude.hpp b/compat/prelude.hpp index 1841e50b..4e8aa7b3 100644 --- a/compat/prelude.hpp +++ b/compat/prelude.hpp @@ -1,7 +1,7 @@ #pragma once -#if !(defined __cpp_size_t_suffix && __cpp_size_t_suffix >= 202006L) -#include "literal-size-type.hpp" -#endif +#include <cstddef> +#include <cstdint> +#include <type_traits> namespace Magnum {} namespace floormat { |