[libcxx-commits] [libcxx] 6491d99 - [libc++] Remove more unnecessary _VSTD:: from type names. NFCI.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 11 09:24:54 PDT 2021


Author: Arthur O'Dwyer
Date: 2021-05-11T12:23:55-04:00
New Revision: 6491d99e330c38b33b9cb6acb19afa3a464febeb

URL: https://github.com/llvm/llvm-project/commit/6491d99e330c38b33b9cb6acb19afa3a464febeb
DIFF: https://github.com/llvm/llvm-project/commit/6491d99e330c38b33b9cb6acb19afa3a464febeb.diff

LOG: [libc++] Remove more unnecessary _VSTD:: from type names. NFCI.

Differential Revision: https://reviews.llvm.org/D102181

Added: 
    

Modified: 
    libcxx/include/__memory/allocator_traits.h
    libcxx/include/algorithm
    libcxx/include/experimental/functional
    libcxx/include/experimental/type_traits
    libcxx/include/functional
    libcxx/include/memory
    libcxx/include/random
    libcxx/include/type_traits

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__memory/allocator_traits.h b/libcxx/include/__memory/allocator_traits.h
index 18b876a3212d5..a5d151043b4a8 100644
--- a/libcxx/include/__memory/allocator_traits.h
+++ b/libcxx/include/__memory/allocator_traits.h
@@ -362,7 +362,7 @@ template <class _Tp>
 struct __is_default_allocator : false_type { };
 
 template <class _Tp>
-struct __is_default_allocator<_VSTD::allocator<_Tp> > : true_type { };
+struct __is_default_allocator<allocator<_Tp> > : true_type { };
 
 // __is_cpp17_move_insertable
 template <class _Alloc, class = void>

diff  --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 7bb6d9e0ec2f1..65655d70425f7 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 <class _RandomAccessIterator, class _Compare>
 _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 {
-    typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::
diff erence_type 
diff erence_type;
+    typedef typename iterator_traits<_RandomAccessIterator>::
diff erence_type 
diff erence_type;
     
diff erence_type __len = __last - __first;
     
diff erence_type __p = 0;
     
diff erence_type __c = 1;

diff  --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional
index 47f9ca5493d9f..e18962002d4ae 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>::
diff erence_type 
diff erence_type;
     typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type      value_type;
     typedef _BMSkipTable<value_type, 
diff erence_type, _Hash, _BinaryPredicate,
-                    _VSTD::is_integral<value_type>::value && // what about enums?
+                    is_integral<value_type>::value && // what about enums?
                     sizeof(value_type) == 1 &&
                     is_same<_Hash, hash<value_type>>::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<
diff erence_type> & __suffix = *__suffix_.get();
         if (__count > 0)
         {
-            _VSTD::vector<value_type> __scratch(__count);
+            vector<value_type> __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>::
diff erence_type 
diff erence_type;
     typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type      value_type;
     typedef _BMSkipTable<value_type, 
diff erence_type, _Hash, _BinaryPredicate,
-                    _VSTD::is_integral<value_type>::value && // what about enums?
+                    is_integral<value_type>::value && // what about enums?
                     sizeof(value_type) == 1 &&
                     is_same<_Hash, hash<value_type>>::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 7ab097226b5d6..ea1335f96af52 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 <class...> 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 3d8138a526456..1eab545bf8535 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 <typename _Fun>
 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 9b01b848974ef..5d53ea5448181 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<bool, _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap::value>());
+      integral_constant<bool, allocator_traits<_Alloc>::propagate_on_container_swap::value>());
 }
 
 template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >

diff  --git a/libcxx/include/random b/libcxx/include/random
index eb2d37d9cda9a..f2eaf840b3bd0 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<double>::iterator __i = __p_.begin(), __e = __p_.end();
-                                                                       __i < __e; ++__i)
+            for (vector<double>::iterator __i = __p_.begin(), __e = __p_.end(); __i < __e; ++__i)
                 *__i /= __s;
             vector<double> __t(__p_.size() - 1);
             _VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
@@ -6312,7 +6311,7 @@ vector<double>
 discrete_distribution<_IntType>::param_type::probabilities() const
 {
     size_t __n = __p_.size();
-    _VSTD::vector<double> __p(__n+1);
+    vector<double> __p(__n+1);
     _VSTD::adjacent_
diff erence(__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 2aebea71d3294..8751ff162c995 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 <class _Tp> _Tp   __declval(long);
 _LIBCPP_SUPPRESS_DEPRECATED_POP
 
 template <class _Tp>
-decltype(_VSTD::__declval<_Tp>(0))
+decltype(__declval<_Tp>(0))
 declval() _NOEXCEPT;
 
 // __uncvref
@@ -1712,7 +1712,7 @@ struct __is_convertible_test : public false_type {};
 
 template <class _From, class _To>
 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 <class _Tp, bool _IsArray =    is_array<_Tp>::value,
@@ -2752,33 +2752,33 @@ struct __destructible_imp;
 
 template <class _Tp>
 struct __destructible_imp<_Tp, false>
-   : public _VSTD::integral_constant<bool,
-        __is_destructor_wellformed<typename _VSTD::remove_all_extents<_Tp>::type>::value> {};
+   : public integral_constant<bool,
+        __is_destructor_wellformed<typename remove_all_extents<_Tp>::type>::value> {};
 
 template <class _Tp>
 struct __destructible_imp<_Tp, true>
-    : public _VSTD::true_type {};
+    : public true_type {};
 
 template <class _Tp, bool>
 struct __destructible_false;
 
 template <class _Tp>
-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 <class _Tp>
-struct __destructible_false<_Tp, true> : public _VSTD::false_type {};
+struct __destructible_false<_Tp, true> : public false_type {};
 
 template <class _Tp>
 struct is_destructible
-    : public __destructible_false<_Tp, _VSTD::is_function<_Tp>::value> {};
+    : public __destructible_false<_Tp, is_function<_Tp>::value> {};
 
 template <class _Tp>
 struct is_destructible<_Tp[]>
-    : public _VSTD::false_type {};
+    : public false_type {};
 
 template <>
 struct is_destructible<void>
-    : public _VSTD::false_type {};
+    : public false_type {};
 
 #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
 template <class _Tp>


        


More information about the libcxx-commits mailing list