From 6491d99e330c38b33b9cb6acb19afa3a464febeb Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Mon, 10 May 2021 13:13:04 -0400 Subject: [PATCH] [libc++] Remove more unnecessary _VSTD:: from type names. NFCI. Differential Revision: https://reviews.llvm.org/D102181 --- libcxx/include/__memory/allocator_traits.h | 2 +- libcxx/include/algorithm | 7 +++---- libcxx/include/experimental/functional | 16 ++++++++-------- libcxx/include/experimental/type_traits | 2 +- libcxx/include/functional | 10 +++++----- libcxx/include/memory | 2 +- libcxx/include/random | 5 ++--- libcxx/include/type_traits | 24 ++++++++++++------------ 8 files changed, 33 insertions(+), 35 deletions(-) diff --git a/libcxx/include/__memory/allocator_traits.h b/libcxx/include/__memory/allocator_traits.h index 18b876a..a5d1510 100644 --- a/libcxx/include/__memory/allocator_traits.h +++ b/libcxx/include/__memory/allocator_traits.h @@ -362,7 +362,7 @@ template struct __is_default_allocator : false_type { }; template -struct __is_default_allocator<_VSTD::allocator<_Tp> > : true_type { }; +struct __is_default_allocator > : true_type { }; // __is_cpp17_move_insertable template diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 7bb6d9e..65655d7 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -3195,7 +3195,7 @@ _SampleIterator __sample(_PopulationIterator __first, __output_iter[__k] = *__first; _Distance __sz = __k; for (; __first != __last; ++__first, (void) ++__k) { - _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g); + _Distance __r = uniform_int_distribution<_Distance>(0, __k)(__g); if (__r < __sz) __output_iter[__r] = *__first; } @@ -3212,8 +3212,7 @@ _SampleIterator __sample(_PopulationIterator __first, forward_iterator_tag) { _Distance __unsampled_sz = _VSTD::distance(__first, __last); for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) { - _Distance __r = - _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g); + _Distance __r = uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g); if (__r < __n) { *__output_iter++ = *__first; --__n; @@ -4914,7 +4913,7 @@ template _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { - typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type; + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; difference_type __len = __last - __first; difference_type __p = 0; difference_type __c = 1; diff --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional index 47f9ca5..e189620 100644 --- a/libcxx/include/experimental/functional +++ b/libcxx/include/experimental/functional @@ -122,8 +122,8 @@ public: operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { return _VSTD::__search(__f, __l, __first_, __last_, __pred_, - typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category(), - typename _VSTD::iterator_traits<_ForwardIterator2>::iterator_category()); + typename iterator_traits<_ForwardIterator>::iterator_category(), + typename iterator_traits<_ForwardIterator2>::iterator_category()); } private: @@ -212,7 +212,7 @@ private: typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type; typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type; typedef _BMSkipTable::value && // what about enums? + is_integral::value && // what about enums? sizeof(value_type) == 1 && is_same<_Hash, hash>::value && is_same<_BinaryPredicate, equal_to<>>::value @@ -247,7 +247,7 @@ public: if (__first_ == __last_) return make_pair(__f, __f); // empty pattern // If the pattern is larger than the corpus, we can't find it! - if ( __pattern_length_ > _VSTD::distance (__f, __l)) + if ( __pattern_length_ > _VSTD::distance(__f, __l)) return make_pair(__l, __l); // Do the search @@ -321,13 +321,13 @@ public: // TODO private: vector & __suffix = *__suffix_.get(); if (__count > 0) { - _VSTD::vector __scratch(__count); + vector __scratch(__count); __compute_bm_prefix(__f, __l, __pred, __scratch); for ( size_t __i = 0; __i <= __count; __i++ ) __suffix[__i] = __count - __scratch[__count-1]; - typedef _VSTD::reverse_iterator<_RandomAccessIterator1> _RevIter; + typedef reverse_iterator<_RandomAccessIterator1> _RevIter; __compute_bm_prefix(_RevIter(__l), _RevIter(__f), __pred, __scratch); for ( size_t __i = 0; __i < __count; __i++ ) @@ -363,7 +363,7 @@ private: typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type; typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type; typedef _BMSkipTable::value && // what about enums? + is_integral::value && // what about enums? sizeof(value_type) == 1 && is_same<_Hash, hash>::value && is_same<_BinaryPredicate, equal_to<>>::value @@ -399,7 +399,7 @@ public: if (__first_ == __last_) return make_pair(__f, __f); // empty pattern // If the pattern is larger than the corpus, we can't find it! - if ( __pattern_length_ > _VSTD::distance (__f, __l)) + if ( __pattern_length_ > _VSTD::distance(__f, __l)) return make_pair(__l, __l); // Do the search diff --git a/libcxx/include/experimental/type_traits b/libcxx/include/experimental/type_traits index 7ab0972..ea1335f 100644 --- a/libcxx/include/experimental/type_traits +++ b/libcxx/include/experimental/type_traits @@ -105,7 +105,7 @@ using raw_invocation_type_t = typename raw_invocation_type<_Tp>::type; // 3.3.4, Detection idiom template using void_t = void; -struct nonesuch : private _VSTD::__nat { // make nonesuch "not an aggregate" +struct nonesuch : private __nat { // make nonesuch "not an aggregate" ~nonesuch() = delete; nonesuch (nonesuch const&) = delete; void operator=(nonesuch const&) = delete; diff --git a/libcxx/include/functional b/libcxx/include/functional index 3d8138a..1eab545 100644 --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -1962,11 +1962,11 @@ union __policy_storage // True if _Fun can safely be held in __policy_storage.__small. template struct __use_small_storage - : public _VSTD::integral_constant< + : public integral_constant< bool, sizeof(_Fun) <= sizeof(__policy_storage) && _LIBCPP_ALIGNOF(_Fun) <= _LIBCPP_ALIGNOF(__policy_storage) && - _VSTD::is_trivially_copy_constructible<_Fun>::value && - _VSTD::is_trivially_destructible<_Fun>::value> {}; + is_trivially_copy_constructible<_Fun>::value && + is_trivially_destructible<_Fun>::value> {}; // Policy contains information about how to copy, destroy, and move the // underlying functor. You can think of it as a vtable of sorts. @@ -3190,8 +3190,8 @@ public: operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { return _VSTD::__search(__f, __l, __first_, __last_, __pred_, - typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category(), - typename _VSTD::iterator_traits<_ForwardIterator2>::iterator_category()); + typename iterator_traits<_ForwardIterator>::iterator_category(), + typename iterator_traits<_ForwardIterator2>::iterator_category()); } private: diff --git a/libcxx/include/memory b/libcxx/include/memory index 9b01b84..5d53ea5 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -863,7 +863,7 @@ void __swap_allocator(_Alloc & __a1, _Alloc & __a2) #endif { _VSTD::__swap_allocator(__a1, __a2, - integral_constant::propagate_on_container_swap::value>()); + integral_constant::propagate_on_container_swap::value>()); } template > diff --git a/libcxx/include/random b/libcxx/include/random index eb2d37d..f2eaf84 100644 --- a/libcxx/include/random +++ b/libcxx/include/random @@ -6292,8 +6292,7 @@ discrete_distribution<_IntType>::param_type::__init() if (__p_.size() > 1) { double __s = _VSTD::accumulate(__p_.begin(), __p_.end(), 0.0); - for (_VSTD::vector::iterator __i = __p_.begin(), __e = __p_.end(); - __i < __e; ++__i) + for (vector::iterator __i = __p_.begin(), __e = __p_.end(); __i < __e; ++__i) *__i /= __s; vector __t(__p_.size() - 1); _VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin()); @@ -6312,7 +6311,7 @@ vector discrete_distribution<_IntType>::param_type::probabilities() const { size_t __n = __p_.size(); - _VSTD::vector __p(__n+1); + vector __p(__n+1); _VSTD::adjacent_difference(__p_.begin(), __p_.end(), __p.begin()); if (__n > 0) __p[__n] = 1 - __p_[__n-1]; diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 2aebea7..8751ff1 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -580,7 +580,7 @@ using _IsSame = _BoolConstant< #ifdef __clang__ __is_same(_Tp, _Up) #else - _VSTD::is_same<_Tp, _Up>::value + is_same<_Tp, _Up>::value #endif >; @@ -589,7 +589,7 @@ using _IsNotSame = _BoolConstant< #ifdef __clang__ !__is_same(_Tp, _Up) #else - !_VSTD::is_same<_Tp, _Up>::value + !is_same<_Tp, _Up>::value #endif >; @@ -1344,7 +1344,7 @@ template _Tp __declval(long); _LIBCPP_SUPPRESS_DEPRECATED_POP template -decltype(_VSTD::__declval<_Tp>(0)) +decltype(__declval<_Tp>(0)) declval() _NOEXCEPT; // __uncvref @@ -1712,7 +1712,7 @@ struct __is_convertible_test : public false_type {}; template struct __is_convertible_test<_From, _To, - decltype(_VSTD::__is_convertible_imp::__test_convert<_To>(declval<_From>()))> : public true_type + decltype(__is_convertible_imp::__test_convert<_To>(declval<_From>()))> : public true_type {}; template ::value, @@ -2752,33 +2752,33 @@ struct __destructible_imp; template struct __destructible_imp<_Tp, false> - : public _VSTD::integral_constant::type>::value> {}; + : public integral_constant::type>::value> {}; template struct __destructible_imp<_Tp, true> - : public _VSTD::true_type {}; + : public true_type {}; template struct __destructible_false; template -struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, _VSTD::is_reference<_Tp>::value> {}; +struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, is_reference<_Tp>::value> {}; template -struct __destructible_false<_Tp, true> : public _VSTD::false_type {}; +struct __destructible_false<_Tp, true> : public false_type {}; template struct is_destructible - : public __destructible_false<_Tp, _VSTD::is_function<_Tp>::value> {}; + : public __destructible_false<_Tp, is_function<_Tp>::value> {}; template struct is_destructible<_Tp[]> - : public _VSTD::false_type {}; + : public false_type {}; template <> struct is_destructible - : public _VSTD::false_type {}; + : public false_type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template -- 2.7.4