From 6cc7d1fb264780b2edf215c6e544239d53b3e37f Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 24 Aug 2018 00:31:27 +0300 Subject: [PATCH] Use std::void_t --- Utilities/bit_set.h | 40 ++++++++++++++++++++-------------------- Utilities/types.h | 22 +++++----------------- rpcs3/Emu/IdManager.h | 10 +++++----- 3 files changed, 30 insertions(+), 42 deletions(-) diff --git a/Utilities/bit_set.h b/Utilities/bit_set.h index cc6b30f74a..8990169263 100644 --- a/Utilities/bit_set.h +++ b/Utilities/bit_set.h @@ -284,7 +284,7 @@ constexpr bs_t operator -(T lhs, typename bs_base::type rhs) } template -struct atomic_add>::value>>> +struct atomic_add>::value>>> { using under = typename bs_base::under; @@ -305,7 +305,7 @@ struct atomic_add -struct atomic_sub>::value>>> +struct atomic_sub>::value>>> { using under = typename bs_base::under; @@ -326,7 +326,7 @@ struct atomic_sub -struct atomic_and>::value>>> +struct atomic_and>::value>>> { using under = typename bs_base::under; @@ -347,7 +347,7 @@ struct atomic_and -struct atomic_xor>::value>>> +struct atomic_xor>::value>>> { using under = typename bs_base::under; @@ -368,7 +368,7 @@ struct atomic_xor -struct atomic_add> +struct atomic_add> { using under = std::underlying_type_t; @@ -389,7 +389,7 @@ struct atomic_add> }; template -struct atomic_sub> +struct atomic_sub> { using under = std::underlying_type_t; @@ -410,7 +410,7 @@ struct atomic_sub> }; template -struct atomic_and> +struct atomic_and> { using under = std::underlying_type_t; @@ -431,7 +431,7 @@ struct atomic_and> }; template -struct atomic_xor> +struct atomic_xor> { using under = std::underlying_type_t; @@ -452,7 +452,7 @@ struct atomic_xor> }; template -struct atomic_test_and_set>::value>>> +struct atomic_test_and_set>::value>>> { using under = typename bs_base::under; @@ -467,7 +467,7 @@ struct atomic_test_and_set -struct atomic_test_and_reset>::value>>> +struct atomic_test_and_reset>::value>>> { using under = typename bs_base::under; @@ -482,7 +482,7 @@ struct atomic_test_and_reset -struct atomic_test_and_complement>::value>>> +struct atomic_test_and_complement>::value>>> { using under = typename bs_base::under; @@ -497,7 +497,7 @@ struct atomic_test_and_complement -struct atomic_test_and_set> +struct atomic_test_and_set> { using under = std::underlying_type_t; @@ -512,7 +512,7 @@ struct atomic_test_and_set> }; template -struct atomic_test_and_reset> +struct atomic_test_and_reset> { using under = std::underlying_type_t; @@ -527,7 +527,7 @@ struct atomic_test_and_reset> }; template -struct atomic_test_and_complement> +struct atomic_test_and_complement> { using under = std::underlying_type_t; @@ -624,7 +624,7 @@ inline bool test_and_complement(T& lhs, T rhs) } template -struct atomic_or::value>>> +struct atomic_or::value>>> { using under = std::underlying_type_t; @@ -645,7 +645,7 @@ struct atomic_or -struct atomic_and::value>>> +struct atomic_and::value>>> { using under = std::underlying_type_t; @@ -666,7 +666,7 @@ struct atomic_and -struct atomic_xor::value>>> +struct atomic_xor::value>>> { using under = std::underlying_type_t; @@ -687,7 +687,7 @@ struct atomic_xor -struct atomic_test_and_set::value>>> +struct atomic_test_and_set::value>>> { using under = std::underlying_type_t; @@ -702,7 +702,7 @@ struct atomic_test_and_set -struct atomic_test_and_reset::value>>> +struct atomic_test_and_reset::value>>> { using under = std::underlying_type_t; @@ -717,7 +717,7 @@ struct atomic_test_and_reset -struct atomic_test_and_complement::value>>> +struct atomic_test_and_complement::value>>> { using under = std::underlying_type_t; diff --git a/Utilities/types.h b/Utilities/types.h index 9c374ce375..d0bc1e6071 100644 --- a/Utilities/types.h +++ b/Utilities/types.h @@ -153,20 +153,8 @@ struct atomic_test_and_complement; template class atomic_t; -#ifdef _MSC_VER -using std::void_t; -#else -namespace void_details -{ - template - struct make_void - { - using type = void; - }; -} - -template -using void_t = typename void_details::make_void::type; +#if defined(__INTELLISENSE__) && !defined(_MSC_VER) +namespace std { template using void_t = void; } #endif // Extract T::simple_type if available, remove cv qualifiers @@ -177,7 +165,7 @@ struct simple_type_helper }; template -struct simple_type_helper> +struct simple_type_helper> { using type = typename T::simple_type; }; @@ -725,7 +713,7 @@ struct narrow_impl::value && std // Simple type enabled (TODO: allow for To as well) template -struct narrow_impl> +struct narrow_impl> : narrow_impl, To> { }; @@ -953,7 +941,7 @@ struct error_code }; template - struct is_error> : std::false_type + struct is_error> : std::false_type { }; diff --git a/rpcs3/Emu/IdManager.h b/rpcs3/Emu/IdManager.h index b38f229790..7f4f8c18d7 100644 --- a/rpcs3/Emu/IdManager.h +++ b/rpcs3/Emu/IdManager.h @@ -25,7 +25,7 @@ namespace id_manager }; template - struct id_traits> + struct id_traits> { static const u32 base = T::id_base; static const u32 step = T::id_step; @@ -83,7 +83,7 @@ namespace id_manager }; template - struct id_verify> : std::integral_constant::value> + struct id_verify> : std::integral_constant::value> { // If T2 contains id_type type, T must be equal to it }; @@ -427,7 +427,7 @@ public: func(*ptr); return ptr; } - + return nullptr; } @@ -537,7 +537,7 @@ public: result++; } } - } + } return result; } @@ -690,7 +690,7 @@ class fxm public: // Initialize object manager static void init(); - + // Remove all objects static void clear();