[libcxx-commits] [libcxx] cfef7c9 - [libc++][NFC] Remove _VSTD:: when not needed.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 10 09:15:57 PDT 2021


Author: Mark de Wever
Date: 2021-05-10T18:15:50+02:00
New Revision: cfef7c918b8297ffb1d882d6b31fe68f876607db

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

LOG: [libc++][NFC] Remove _VSTD:: when not needed.

Reviewed By: #libc, Quuxplusone

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

Added: 
    

Modified: 
    libcxx/include/__memory/shared_ptr.h
    libcxx/include/algorithm
    libcxx/include/compare
    libcxx/include/concepts
    libcxx/include/format
    libcxx/include/functional
    libcxx/include/iomanip
    libcxx/include/set

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index e652cecc03dcd..0079a1fd53654 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -579,7 +579,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     _LIBCPP_INLINE_VISIBILITY
     element_type* operator->() const _NOEXCEPT
     {
-        static_assert(!_VSTD::is_array<_Tp>::value,
+        static_assert(!is_array<_Tp>::value,
                       "std::shared_ptr<T>::operator-> is only valid when T is not an array type.");
         return __ptr_;
     }
@@ -607,7 +607,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     _LIBCPP_INLINE_VISIBILITY
     operator[](ptr
diff _t __i) const
     {
-            static_assert(_VSTD::is_array<_Tp>::value,
+            static_assert(is_array<_Tp>::value,
                           "std::shared_ptr<T>::operator[] is only valid when T is an array type.");
             return __ptr_[__i];
     }

diff  --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 60181224ea117..7b1191cf14456 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -2483,8 +2483,8 @@ _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 __rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
          _VSTD::forward_iterator_tag)
 {
-    typedef typename _VSTD::iterator_traits<_ForwardIterator>::value_type value_type;
-    if (_VSTD::is_trivially_move_assignable<value_type>::value)
+    typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+    if (is_trivially_move_assignable<value_type>::value)
     {
         if (_VSTD::next(__first) == __middle)
             return _VSTD::__rotate_left(__first, __last);
@@ -2496,10 +2496,10 @@ template <class _BidirectionalIterator>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
 __rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
-         _VSTD::bidirectional_iterator_tag)
+         bidirectional_iterator_tag)
 {
-    typedef typename _VSTD::iterator_traits<_BidirectionalIterator>::value_type value_type;
-    if (_VSTD::is_trivially_move_assignable<value_type>::value)
+    typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+    if (is_trivially_move_assignable<value_type>::value)
     {
         if (_VSTD::next(__first) == __middle)
             return _VSTD::__rotate_left(__first, __last);
@@ -2513,10 +2513,10 @@ template <class _RandomAccessIterator>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
 __rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
-         _VSTD::random_access_iterator_tag)
+         random_access_iterator_tag)
 {
-    typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::value_type value_type;
-    if (_VSTD::is_trivially_move_assignable<value_type>::value)
+    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+    if (is_trivially_move_assignable<value_type>::value)
     {
         if (_VSTD::next(__first) == __middle)
             return _VSTD::__rotate_left(__first, __last);
@@ -2537,7 +2537,7 @@ rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __l
     if (__middle == __last)
         return __first;
     return _VSTD::__rotate(__first, __middle, __last,
-                           typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category());
+                           typename iterator_traits<_ForwardIterator>::iterator_category());
 }
 
 // rotate_copy

diff  --git a/libcxx/include/compare b/libcxx/include/compare
index 12c7aa0a740ef..7d483a77c59c5 100644
--- a/libcxx/include/compare
+++ b/libcxx/include/compare
@@ -157,7 +157,7 @@ struct _CmpUnspecifiedParam {
   _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEVAL
   _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {}
 
-  template<typename _Tp, typename = _VSTD::enable_if_t<!_VSTD::is_same_v<_Tp, int>>>
+  template<typename _Tp, typename = enable_if_t<!is_same_v<_Tp, int>>>
   _CmpUnspecifiedParam(_Tp) = delete;
 };
 

diff  --git a/libcxx/include/concepts b/libcxx/include/concepts
index 39c1f63f90a28..7195b3bb05a32 100644
--- a/libcxx/include/concepts
+++ b/libcxx/include/concepts
@@ -217,12 +217,12 @@ concept assignable_from =
 // [concept.destructible]
 
 template<class _Tp>
-concept destructible = _VSTD::is_nothrow_destructible_v<_Tp>;
+concept destructible = is_nothrow_destructible_v<_Tp>;
 
 // [concept.constructible]
 template<class _Tp, class... _Args>
 concept constructible_from =
-    destructible<_Tp> && _VSTD::is_constructible_v<_Tp, _Args...>;
+    destructible<_Tp> && is_constructible_v<_Tp, _Args...>;
 
 // [concept.default.init]
 

diff  --git a/libcxx/include/format b/libcxx/include/format
index 25398ad6a7c42..d9d43d82d1813 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -105,13 +105,13 @@ class _LIBCPP_TEMPLATE_VIS basic_format_parse_context {
 public:
   using char_type = _CharT;
   using const_iterator =
-      typename _VSTD::basic_string_view<_CharT>::const_iterator;
+      typename basic_string_view<_CharT>::const_iterator;
   using iterator = const_iterator;
 
 public:
   _LIBCPP_INLINE_VISIBILITY
   constexpr explicit basic_format_parse_context(
-      _VSTD::basic_string_view<_CharT> __fmt, size_t __num_args = 0) noexcept
+      basic_string_view<_CharT> __fmt, size_t __num_args = 0) noexcept
       : __begin_(__fmt.begin()),
         __end_(__fmt.end()),
         __indexing_(__unknown),
@@ -156,7 +156,7 @@ public:
     //   expressions ([expr.const]).
     // Note: the Throws clause [format.parse.ctx]/10 doesn't specify the
     // behavior when id >= num_args_.
-    if (_VSTD::is_constant_evaluated() && __id >= __num_args_)
+    if (is_constant_evaluated() && __id >= __num_args_)
       __throw_format_error("Argument index outside the valid range");
   }
 

diff  --git a/libcxx/include/functional b/libcxx/include/functional
index 19d74a3ec6bb8..3d8138a526456 100644
--- a/libcxx/include/functional
+++ b/libcxx/include/functional
@@ -2050,7 +2050,7 @@ struct __policy
 // faster for types that can be passed in registers.
 template <typename _Tp>
 using __fast_forward =
-    typename _VSTD::conditional<_VSTD::is_scalar<_Tp>::value, _Tp, _Tp&&>::type;
+    typename conditional<is_scalar<_Tp>::value, _Tp, _Tp&&>::type;
 
 // __policy_invoker calls an instance of __alloc_func held in __policy_storage.
 

diff  --git a/libcxx/include/iomanip b/libcxx/include/iomanip
index b2941fa352c21..47d573b5fc8aa 100644
--- a/libcxx/include/iomanip
+++ b/libcxx/include/iomanip
@@ -518,7 +518,7 @@ basic_ostream<_CharT, _Traits> &
 __quoted_output ( basic_ostream<_CharT, _Traits> &__os,
         _ForwardIterator __first, _ForwardIterator __last, _CharT __delim, _CharT __escape )
 {
-    _VSTD::basic_string<_CharT, _Traits> __str;
+    basic_string<_CharT, _Traits> __str;
     __str.push_back(__delim);
     for ( ; __first != __last; ++ __first )
     {

diff  --git a/libcxx/include/set b/libcxx/include/set
index 0a1cc0618d9ca..0612dd55d837b 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -1316,11 +1316,11 @@ public:
 #if _LIBCPP_STD_VER > 11
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     find(const _K2& __k)                           {return __tree_.find(__k);}
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     find(const _K2& __k) const                     {return __tree_.find(__k);}
 #endif
 
@@ -1352,12 +1352,12 @@ public:
 #if _LIBCPP_STD_VER > 11
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}
 
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
 #endif
 
@@ -1370,11 +1370,11 @@ public:
 #if _LIBCPP_STD_VER > 11
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     upper_bound(const _K2& __k)       {return __tree_.upper_bound(__k);}
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
 #endif
 
@@ -1387,11 +1387,11 @@ public:
 #if _LIBCPP_STD_VER > 11
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
     equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
     template <typename _K2>
     _LIBCPP_INLINE_VISIBILITY
-    typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
+    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
     equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
 #endif
 };


        


More information about the libcxx-commits mailing list