Browse Source

is_transparent: more concepts, less sfinae

skypjack 4 tháng trước cách đây
mục cha
commit
32dc7a37c2
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      src/entt/core/type_traits.hpp

+ 3 - 2
src/entt/core/type_traits.hpp

@@ -701,12 +701,13 @@ inline constexpr bool is_ebco_eligible_v = is_ebco_eligible<Type>::value;
  * is valid and denotes a type, false otherwise.
  * @tparam Type The type to test.
  */
-template<typename Type, typename = void>
+template<typename Type>
 struct is_transparent: std::false_type {};
 
 /*! @copydoc is_transparent */
 template<typename Type>
-struct is_transparent<Type, std::void_t<typename Type::is_transparent>>: std::true_type {};
+requires requires { typename Type::is_transparent; }
+struct is_transparent<Type>: std::true_type {};
 
 /**
  * @brief Helper variable template.