From 8b8ad75cc94aad88c505bdca71c903774f9e75c7 Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Tue, 21 May 2024 01:23:21 -0700 Subject: [PATCH] [libcxx] removes unnecessary traits from `has_unique_object_representations` (#69241) `remove_cv_t` and `remove_all_extents_t` are taken care of by the built-in trait, so we don't need to use them directly. --------- Co-authored-by: Louis Dionne --- .../__type_traits/has_unique_object_representation.h | 6 ++---- .../has_unique_object_representations.pass.cpp | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libcxx/include/__type_traits/has_unique_object_representation.h b/libcxx/include/__type_traits/has_unique_object_representation.h index c0ada5618f0e3e..1aa044990032af 100644 --- a/libcxx/include/__type_traits/has_unique_object_representation.h +++ b/libcxx/include/__type_traits/has_unique_object_representation.h @@ -11,8 +11,6 @@ #include <__config> #include <__type_traits/integral_constant.h> -#include <__type_traits/remove_all_extents.h> -#include <__type_traits/remove_cv.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -24,10 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD template struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations - : public integral_constant>)> {}; + : public integral_constant {}; template -inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<_Tp>::value; +inline constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Tp); #endif diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp index ce34c8e958dba4..b8b84bb9088275 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp @@ -99,6 +99,8 @@ int main(int, char**) test_has_unique_object_representations(); test_has_unique_object_representations(); test_has_unique_object_representations(); + test_has_unique_object_representations(); + test_has_unique_object_representations(); test_has_unique_object_representations();