Skip to content

Commit

Permalink
[libcxx] removes unnecessary traits from `has_unique_object_represent…
Browse files Browse the repository at this point in the history
…ations` (#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 <[email protected]>
  • Loading branch information
cjdb and ldionne authored May 21, 2024
1 parent fea29ee commit 8b8ad75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,10 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
: public integral_constant<bool, __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {};
: public integral_constant<bool, __has_unique_object_representations(_Tp)> {};

template <class _Tp>
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ int main(int, char**)
test_has_unique_object_representations<unsigned>();
test_has_unique_object_representations<NonEmptyUnion>();
test_has_unique_object_representations<char[3]>();
test_has_unique_object_representations<char[3][4]>();
test_has_unique_object_representations<char[3][4][5]>();
test_has_unique_object_representations<char[]>();


Expand Down

0 comments on commit 8b8ad75

Please sign in to comment.