Skip to content

[libc++][NFC] Remove __remove_uncvref #140531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libcxx/include/__functional/boyer_moore_searcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class boyer_moore_searcher {
template <class _RandomAccessIterator2>
_LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2>
operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const {
static_assert(__is_same_uncvref<typename iterator_traits<_RandomAccessIterator1>::value_type,
typename iterator_traits<_RandomAccessIterator2>::value_type>::value,
static_assert(is_same_v<typename iterator_traits<_RandomAccessIterator1>::value_type,
typename iterator_traits<_RandomAccessIterator2>::value_type>,
"Corpus and Pattern iterators must point to the same type");
if (__first == __last)
return std::make_pair(__last, __last);
Expand Down Expand Up @@ -256,8 +256,8 @@ class boyer_moore_horspool_searcher {
template <class _RandomAccessIterator2>
_LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2>
operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const {
static_assert(__is_same_uncvref<typename std::iterator_traits<_RandomAccessIterator1>::value_type,
typename std::iterator_traits<_RandomAccessIterator2>::value_type>::value,
static_assert(is_same_v<typename std::iterator_traits<_RandomAccessIterator1>::value_type,
typename std::iterator_traits<_RandomAccessIterator2>::value_type>,
"Corpus and Pattern iterators must point to the same type");
if (__first == __last)
return std::make_pair(__last, __last);
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__functional/reference_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class reference_wrapper : public __weak_result_type<_Tp> {
public:
template <class _Up,
class = __void_t<decltype(__fun(std::declval<_Up>()))>,
__enable_if_t<!__is_same_uncvref<_Up, reference_wrapper>::value, int> = 0>
__enable_if_t<!is_same<__remove_cvref_t<_Up>, reference_wrapper>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper(_Up&& __u)
_NOEXCEPT_(noexcept(__fun(std::declval<_Up>()))) {
type& __f = static_cast<_Up&&>(__u);
Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/__hash_table
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {

_LIBCPP_HIDE_FROM_ABI static key_type const& __get_key(__container_value_type const& __v) { return __v.first; }

template <class _Up, __enable_if_t<__is_same_uncvref<_Up, __node_value_type>::value, int> = 0>
template <class _Up, __enable_if_t<is_same<__remove_cvref_t<_Up>, __node_value_type>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI static __container_value_type const& __get_value(_Up& __t) {
return __t.__get_value();
}

template <class _Up, __enable_if_t<__is_same_uncvref<_Up, __container_value_type>::value, int> = 0>
template <class _Up, __enable_if_t<is_same<__remove_cvref_t<_Up>, __container_value_type>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI static __container_value_type const& __get_value(_Up& __t) {
return __t;
}
Expand Down Expand Up @@ -842,7 +842,7 @@ public:
return __emplace_unique_key_args(_NodeTypes::__get_key(__x), std::move(__x));
}

template <class _Pp, __enable_if_t<!__is_same_uncvref<_Pp, __container_value_type>::value, int> = 0>
template <class _Pp, __enable_if_t<!is_same<__remove_cvref_t<_Pp>, __container_value_type>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __insert_unique(_Pp&& __x) {
return __emplace_unique(std::forward<_Pp>(__x));
}
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__tree
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
typedef __container_value_type __map_value_type;
static const bool __is_map = true;

template <class _Up, __enable_if_t<__is_same_uncvref<_Up, __container_value_type>::value, int> = 0>
template <class _Up, __enable_if_t<is_same<__remove_cvref_t<_Up>, __container_value_type>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI static key_type const& __get_key(_Up& __t) {
return __t.first;
}
Expand Down
4 changes: 0 additions & 4 deletions libcxx/include/__type_traits/remove_cvref.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H

#include <__config>
#include <__type_traits/is_same.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand All @@ -31,9 +30,6 @@ template <class _Tp>
using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
#endif // __has_builtin(__remove_cvref)

template <class _Tp, class _Up>
using __is_same_uncvref _LIBCPP_NODEBUG = _IsSame<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up> >;

#if _LIBCPP_STD_VER >= 20
template <class _Tp>
struct _LIBCPP_NO_SPECIALIZATIONS remove_cvref {
Expand Down
22 changes: 11 additions & 11 deletions libcxx/include/string
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type())
Expand All @@ -1139,7 +1139,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {
__self_view __sv = __t;
Expand All @@ -1148,7 +1148,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t, const allocator_type& __a)
: __alloc_(__a) {
Expand Down Expand Up @@ -1207,7 +1207,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const _Tp& __t) {
__self_view __sv = __t;
Expand Down Expand Up @@ -1344,7 +1344,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string >::value,
!is_same<__remove_cvref_t<_Tp>, basic_string >::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(const _Tp& __t) {
__self_view __sv = __t;
Expand Down Expand Up @@ -1373,7 +1373,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const _Tp& __t) {
__self_view __sv = __t;
Expand All @@ -1384,7 +1384,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
append(const _Tp& __t, size_type __pos, size_type __n = npos) {
Expand Down Expand Up @@ -1511,7 +1511,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
assign(const _Tp& __t, size_type __pos, size_type __n = npos) {
Expand Down Expand Up @@ -1581,7 +1581,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n = npos) {
Expand Down Expand Up @@ -1662,7 +1662,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos) {
Expand Down Expand Up @@ -2007,7 +2007,7 @@ public:

template <class _Tp,
__enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
!__is_same_uncvref<_Tp, basic_string>::value,
!is_same<__remove_cvref_t<_Tp>, basic_string>::value,
int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos) const {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/unordered_map
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ public:
return *this;
}

template <class _ValueTp, __enable_if_t<__is_same_uncvref<_ValueTp, value_type>::value, int> = 0>
template <class _ValueTp, __enable_if_t<is_same<__remove_cvref_t<_ValueTp>, value_type>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI __hash_value_type& operator=(_ValueTp&& __v) {
__ref() = std::forward<_ValueTp>(__v);
return *this;
Expand Down
Loading