mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Use std::void_t
This commit is contained in:
parent
fba4dbf498
commit
6cc7d1fb26
3 changed files with 30 additions and 42 deletions
|
@ -284,7 +284,7 @@ constexpr bs_t<T> operator -(T lhs, typename bs_base<T>::type rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename BS, typename T>
|
template<typename BS, typename T>
|
||||||
struct atomic_add<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
struct atomic_add<BS, T, std::void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
||||||
{
|
{
|
||||||
using under = typename bs_base<T>::under;
|
using under = typename bs_base<T>::under;
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ struct atomic_add<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BS, typename T>
|
template<typename BS, typename T>
|
||||||
struct atomic_sub<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
struct atomic_sub<BS, T, std::void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
||||||
{
|
{
|
||||||
using under = typename bs_base<T>::under;
|
using under = typename bs_base<T>::under;
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ struct atomic_sub<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BS, typename T>
|
template<typename BS, typename T>
|
||||||
struct atomic_and<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
struct atomic_and<BS, T, std::void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
||||||
{
|
{
|
||||||
using under = typename bs_base<T>::under;
|
using under = typename bs_base<T>::under;
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ struct atomic_and<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BS, typename T>
|
template<typename BS, typename T>
|
||||||
struct atomic_xor<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
struct atomic_xor<BS, T, std::void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
||||||
{
|
{
|
||||||
using under = typename bs_base<T>::under;
|
using under = typename bs_base<T>::under;
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ struct atomic_xor<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_add<T, T, void_t<decltype(T::__bitset_set_type)>>
|
struct atomic_add<T, T, std::void_t<decltype(T::__bitset_set_type)>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ struct atomic_add<T, T, void_t<decltype(T::__bitset_set_type)>>
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_sub<T, T, void_t<decltype(T::__bitset_set_type)>>
|
struct atomic_sub<T, T, std::void_t<decltype(T::__bitset_set_type)>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ struct atomic_sub<T, T, void_t<decltype(T::__bitset_set_type)>>
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_and<T, T, void_t<decltype(T::__bitset_set_type)>>
|
struct atomic_and<T, T, std::void_t<decltype(T::__bitset_set_type)>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ struct atomic_and<T, T, void_t<decltype(T::__bitset_set_type)>>
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_xor<T, T, void_t<decltype(T::__bitset_set_type)>>
|
struct atomic_xor<T, T, std::void_t<decltype(T::__bitset_set_type)>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ struct atomic_xor<T, T, void_t<decltype(T::__bitset_set_type)>>
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BS, typename T>
|
template<typename BS, typename T>
|
||||||
struct atomic_test_and_set<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
struct atomic_test_and_set<BS, T, std::void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
||||||
{
|
{
|
||||||
using under = typename bs_base<T>::under;
|
using under = typename bs_base<T>::under;
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ struct atomic_test_and_set<BS, T, void_t<decltype(T::__bitset_enum_max), std::en
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BS, typename T>
|
template<typename BS, typename T>
|
||||||
struct atomic_test_and_reset<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
struct atomic_test_and_reset<BS, T, std::void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
||||||
{
|
{
|
||||||
using under = typename bs_base<T>::under;
|
using under = typename bs_base<T>::under;
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ struct atomic_test_and_reset<BS, T, void_t<decltype(T::__bitset_enum_max), std::
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BS, typename T>
|
template<typename BS, typename T>
|
||||||
struct atomic_test_and_complement<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
struct atomic_test_and_complement<BS, T, std::void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
|
||||||
{
|
{
|
||||||
using under = typename bs_base<T>::under;
|
using under = typename bs_base<T>::under;
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ struct atomic_test_and_complement<BS, T, void_t<decltype(T::__bitset_enum_max),
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_test_and_set<T, T, void_t<decltype(T::__bitset_set_type)>>
|
struct atomic_test_and_set<T, T, std::void_t<decltype(T::__bitset_set_type)>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ struct atomic_test_and_set<T, T, void_t<decltype(T::__bitset_set_type)>>
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_test_and_reset<T, T, void_t<decltype(T::__bitset_set_type)>>
|
struct atomic_test_and_reset<T, T, std::void_t<decltype(T::__bitset_set_type)>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -527,7 +527,7 @@ struct atomic_test_and_reset<T, T, void_t<decltype(T::__bitset_set_type)>>
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_test_and_complement<T, T, void_t<decltype(T::__bitset_set_type)>>
|
struct atomic_test_and_complement<T, T, std::void_t<decltype(T::__bitset_set_type)>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ inline bool test_and_complement(T& lhs, T rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_or<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
struct atomic_or<T, T, std::void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -645,7 +645,7 @@ struct atomic_or<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_and<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
struct atomic_and<T, T, std::void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -666,7 +666,7 @@ struct atomic_and<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_xor<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
struct atomic_xor<T, T, std::void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -687,7 +687,7 @@ struct atomic_xor<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_test_and_set<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
struct atomic_test_and_set<T, T, std::void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -702,7 +702,7 @@ struct atomic_test_and_set<T, T, void_t<decltype(T::__bitwise_ops), std::enable_
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_test_and_reset<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
struct atomic_test_and_reset<T, T, std::void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
@ -717,7 +717,7 @@ struct atomic_test_and_reset<T, T, void_t<decltype(T::__bitwise_ops), std::enabl
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct atomic_test_and_complement<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
struct atomic_test_and_complement<T, T, std::void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
|
||||||
{
|
{
|
||||||
using under = std::underlying_type_t<T>;
|
using under = std::underlying_type_t<T>;
|
||||||
|
|
||||||
|
|
|
@ -153,20 +153,8 @@ struct atomic_test_and_complement;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class atomic_t;
|
class atomic_t;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#if defined(__INTELLISENSE__) && !defined(_MSC_VER)
|
||||||
using std::void_t;
|
namespace std { template <typename...> using void_t = void; }
|
||||||
#else
|
|
||||||
namespace void_details
|
|
||||||
{
|
|
||||||
template <typename...>
|
|
||||||
struct make_void
|
|
||||||
{
|
|
||||||
using type = void;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename... T>
|
|
||||||
using void_t = typename void_details::make_void<T...>::type;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Extract T::simple_type if available, remove cv qualifiers
|
// Extract T::simple_type if available, remove cv qualifiers
|
||||||
|
@ -177,7 +165,7 @@ struct simple_type_helper
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct simple_type_helper<T, void_t<typename T::simple_type>>
|
struct simple_type_helper<T, std::void_t<typename T::simple_type>>
|
||||||
{
|
{
|
||||||
using type = typename T::simple_type;
|
using type = typename T::simple_type;
|
||||||
};
|
};
|
||||||
|
@ -725,7 +713,7 @@ struct narrow_impl<From, To, std::enable_if_t<std::is_signed<From>::value && std
|
||||||
|
|
||||||
// Simple type enabled (TODO: allow for To as well)
|
// Simple type enabled (TODO: allow for To as well)
|
||||||
template <typename From, typename To>
|
template <typename From, typename To>
|
||||||
struct narrow_impl<From, To, void_t<typename From::simple_type>>
|
struct narrow_impl<From, To, std::void_t<typename From::simple_type>>
|
||||||
: narrow_impl<simple_t<From>, To>
|
: narrow_impl<simple_t<From>, To>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@ -953,7 +941,7 @@ struct error_code
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename ET>
|
template<typename ET>
|
||||||
struct is_error<ET, void_t<decltype(ET::__not_an_error)>> : std::false_type
|
struct is_error<ET, std::void_t<decltype(ET::__not_an_error)>> : std::false_type
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace id_manager
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct id_traits<T, void_t<decltype(&T::id_base), decltype(&T::id_step), decltype(&T::id_count)>>
|
struct id_traits<T, std::void_t<decltype(&T::id_base), decltype(&T::id_step), decltype(&T::id_count)>>
|
||||||
{
|
{
|
||||||
static const u32 base = T::id_base;
|
static const u32 base = T::id_base;
|
||||||
static const u32 step = T::id_step;
|
static const u32 step = T::id_step;
|
||||||
|
@ -83,7 +83,7 @@ namespace id_manager
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, typename T2>
|
template <typename T, typename T2>
|
||||||
struct id_verify<T, T2, void_t<typename T2::id_type>> : std::integral_constant<bool, std::is_same<T, typename T2::id_type>::value>
|
struct id_verify<T, T2, std::void_t<typename T2::id_type>> : std::integral_constant<bool, std::is_same<T, typename T2::id_type>::value>
|
||||||
{
|
{
|
||||||
// If T2 contains id_type type, T must be equal to it
|
// If T2 contains id_type type, T must be equal to it
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue