diff --git a/plugins/libimhex/include/helpers/utils.hpp b/plugins/libimhex/include/helpers/utils.hpp index cecc53881..6e2ff7db1 100644 --- a/plugins/libimhex/include/helpers/utils.hpp +++ b/plugins/libimhex/include/helpers/utils.hpp @@ -66,6 +66,13 @@ namespace hex { #define TOKEN_CONCAT_IMPL(x, y) x ## y #define TOKEN_CONCAT(x, y) TOKEN_CONCAT_IMPL(x, y) +template<> +struct std::is_integral : public std::true_type { }; +template<> +struct std::is_integral : public std::true_type { }; +template<> +struct std::is_signed : public std::true_type { }; + namespace hex { template diff --git a/plugins/libimhex/include/hex.hpp b/plugins/libimhex/include/hex.hpp index c527edbde..824fede55 100644 --- a/plugins/libimhex/include/hex.hpp +++ b/plugins/libimhex/include/hex.hpp @@ -23,52 +23,4 @@ extern char **mainArgv; #define MAGIC_PATH_SEPARATOR ";" #else #define MAGIC_PATH_SEPARATOR ":" -#endif - -template<> -struct std::is_integral : public std::true_type { }; -template<> -struct std::is_integral : public std::true_type { }; -template<> -struct std::is_signed : public std::true_type { }; - -#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 12000 -#if __has_include() -// Make sure we break when derived_from is implemented in libc++. Then we can fix a compatibility version above -#include -#endif -// libcxx 12 still doesn't have many default concepts implemented, as a result we need to define it ourself using clang built-ins. -// [concept.derived] (patch from https://reviews.llvm.org/D74292) -namespace hex { -template -concept derived_from = - __is_base_of(_Bp, _Dp) && __is_convertible_to(const volatile _Dp*, const volatile _Bp*); -} - -// [concepts.arithmetic] (patch from https://reviews.llvm.org/D88131) -namespace hex { -template -concept integral = __is_integral(_Tp); - -template -concept signed_integral = integral<_Tp> && __is_signed(_Tp); - -template -concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>; - -template -concept floating_point = __is_floating_point(_Tp); -} -#else -// Assume supported -#include - -namespace hex { - using std::derived_from; - - using std::integral; - using std::signed_integral; - using std::unsigned_integral; - using std::floating_point; -} #endif \ No newline at end of file