diff --git a/include/__bit_reference b/include/__bit_reference
index 0b006dc..57b92ea 100644
--- a/include/__bit_reference
+++ b/include/__bit_reference
@@ -142,25 +142,25 @@
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _STD::min(__clz_f, __n);
+        __storage_type __dn = _VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         __storage_type __b = *__first.__seg_ & __m;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
         __n -= __dn;
         ++__first.__seg_;
     }
     // do middle whole words
     for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
         if (*__first.__seg_)
-            return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(*__first.__seg_)));
+            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(*__first.__seg_)));
     // do last partial word
     if (__n > 0)
     {
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
         __storage_type __b = *__first.__seg_ & __m;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
     }
     return _It(__first.__seg_, static_cast<unsigned>(__n));
 }
@@ -176,11 +176,11 @@
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _STD::min(__clz_f, __n);
+        __storage_type __dn = _VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         __storage_type __b = ~(*__first.__seg_ & __m);
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
         __n -= __dn;
         ++__first.__seg_;
     }
@@ -189,7 +189,7 @@
     {
         __storage_type __b = ~*__first.__seg_;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
     }
     // do last partial word
     if (__n > 0)
@@ -197,7 +197,7 @@
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
         __storage_type __b = ~(*__first.__seg_ & __m);
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
     }
     return _It(__first.__seg_, static_cast<unsigned>(__n));
 }
@@ -227,20 +227,20 @@
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _STD::min(__clz_f, __n);
+        __storage_type __dn = _VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
-        __r = _STD::__pop_count(*__first.__seg_ & __m);
+        __r = _VSTD::__pop_count(*__first.__seg_ & __m);
         __n -= __dn;
         ++__first.__seg_;
     }
     // do middle whole words
     for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
-        __r += _STD::__pop_count(*__first.__seg_);
+        __r += _VSTD::__pop_count(*__first.__seg_);
     // do last partial word
     if (__n > 0)
     {
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
-        __r += _STD::__pop_count(*__first.__seg_ & __m);
+        __r += _VSTD::__pop_count(*__first.__seg_ & __m);
     }
     return __r;
 }
@@ -258,20 +258,20 @@
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _STD::min(__clz_f, __n);
+        __storage_type __dn = _VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
-        __r = _STD::__pop_count(~(*__first.__seg_ & __m));
+        __r = _VSTD::__pop_count(~(*__first.__seg_ & __m));
         __n -= __dn;
         ++__first.__seg_;
     }
     // do middle whole words
     for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
-        __r += _STD::__pop_count(~*__first.__seg_);
+        __r += _VSTD::__pop_count(~*__first.__seg_);
     // do last partial word
     if (__n > 0)
     {
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
-        __r += _STD::__pop_count(~(*__first.__seg_ & __m));
+        __r += _VSTD::__pop_count(~(*__first.__seg_ & __m));
     }
     return __r;
 }
@@ -299,7 +299,7 @@
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _STD::min(__clz_f, __n);
+        __storage_type __dn = _VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         *__first.__seg_ &= ~__m;
         __n -= __dn;
@@ -307,7 +307,7 @@
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _STD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
+    _VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -329,7 +329,7 @@
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _STD::min(__clz_f, __n);
+        __storage_type __dn = _VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         *__first.__seg_ |= __m;
         __n -= __dn;
@@ -337,7 +337,7 @@
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _STD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
+    _VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -369,7 +369,7 @@
 void
 fill(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, bool __value)
 {
-    _STD::fill_n(__first, static_cast<typename _C::size_type>(__last - __first), __value);
+    _VSTD::fill_n(__first, static_cast<typename _C::size_type>(__last - __first), __value);
 }
 
 // copy
@@ -390,7 +390,7 @@
         if (__first.__ctz_ != 0)
         {
             unsigned __clz = __bits_per_word - __first.__ctz_;
-            difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
             __storage_type __b = *__first.__seg_ & __m;
@@ -404,7 +404,7 @@
         // __first.__ctz_ == 0;
         // do middle words
         __storage_type __nw = __n / __bits_per_word;
-        _STD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         __result.__seg_ += __nw;
         // do last word
@@ -437,12 +437,12 @@
         if (__first.__ctz_ != 0)
         {
             unsigned __clz_f = __bits_per_word - __first.__ctz_;
-            difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
             __storage_type __b = *__first.__seg_ & __m;
             unsigned __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
+            __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
             *__result.__seg_ &= ~__m;
             if (__result.__ctz_ > __first.__ctz_)
@@ -480,7 +480,7 @@
         {
             __m = ~__storage_type(0) >> (__bits_per_word - __n);
             __storage_type __b = *__first.__seg_ & __m;
-            __storage_type __dn = _STD::min(__n, static_cast<difference_type>(__clz_r));
+            __storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__clz_r));
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
             *__result.__seg_ &= ~__m;
             *__result.__seg_ |= __b << __result.__ctz_;
@@ -526,7 +526,7 @@
         // do first word
         if (__last.__ctz_ != 0)
         {
-            difference_type __dn = _STD::min(static_cast<difference_type>(__last.__ctz_), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
             __n -= __dn;
             unsigned __clz = __bits_per_word - __last.__ctz_;
             __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz);
@@ -543,7 +543,7 @@
         __storage_type __nw = __n / __bits_per_word;
         __result.__seg_ -= __nw;
         __last.__seg_ -= __nw;
-        _STD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         // do last word
         if (__n > 0)
@@ -573,13 +573,13 @@
         // do first word
         if (__last.__ctz_ != 0)
         {
-            difference_type __dn = _STD::min(static_cast<difference_type>(__last.__ctz_), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
             __n -= __dn;
             unsigned __clz_l = __bits_per_word - __last.__ctz_;
             __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_l);
             __storage_type __b = *__last.__seg_ & __m;
             unsigned __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __ddn = _STD::min(__dn, static_cast<difference_type>(__result.__ctz_));
+            __storage_type __ddn = _VSTD::min(__dn, static_cast<difference_type>(__result.__ctz_));
             if (__ddn > 0)
             {
                 __m = (~__storage_type(0) << (__result.__ctz_ - __ddn)) & (~__storage_type(0) >> __clz_r);
@@ -623,7 +623,7 @@
             __m = ~__storage_type(0) << (__bits_per_word - __n);
             __storage_type __b = *--__last.__seg_ & __m;
             unsigned __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __dn = _STD::min(__n, static_cast<difference_type>(__result.__ctz_));
+            __storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__result.__ctz_));
             __m = (~__storage_type(0) << (__result.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_r);
             *__result.__seg_ &= ~__m;
             *__result.__seg_ |= __b >> (__bits_per_word - __result.__ctz_);
@@ -661,7 +661,7 @@
 __bit_iterator<_C, false>
 move(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result)
 {
-    return _STD::copy(__first, __last, __result);
+    return _VSTD::copy(__first, __last, __result);
 }
 
 // move_backward
@@ -671,7 +671,7 @@
 __bit_iterator<_C, false>
 move_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result)
 {
-    return _STD::copy(__first, __last, __result);
+    return _VSTD::copy(__first, __last, __result);
 }
 
 // swap_ranges
@@ -692,7 +692,7 @@
         if (__first.__ctz_ != 0)
         {
             unsigned __clz = __bits_per_word - __first.__ctz_;
-            difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
             __storage_type __b1 = *__first.__seg_ & __m;
@@ -742,13 +742,13 @@
         if (__first.__ctz_ != 0)
         {
             unsigned __clz_f = __bits_per_word - __first.__ctz_;
-            difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
             __storage_type __b1 = *__first.__seg_ & __m;
             *__first.__seg_ &= ~__m;
             unsigned __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
+            __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
             __storage_type __b2 = *__result.__seg_ & __m;
             *__result.__seg_ &= ~__m;
@@ -803,7 +803,7 @@
             __m = ~__storage_type(0) >> (__bits_per_word - __n);
             __storage_type __b1 = *__first.__seg_ & __m;
             *__first.__seg_ &= ~__m;
-            __storage_type __dn = _STD::min<__storage_type>(__n, __clz_r);
+            __storage_type __dn = _VSTD::min<__storage_type>(__n, __clz_r);
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
             __storage_type __b2 = *__result.__seg_ & __m;
             *__result.__seg_ &= ~__m;
@@ -877,13 +877,13 @@
             if (__d1 <= __bit_array<_C>::capacity())
             {
                 __bit_array<_C> __b(__d1);
-                _STD::copy(__first, __middle, __b.begin());
-                _STD::copy(__b.begin(), __b.end(), _STD::copy(__middle, __last, __first));
+                _VSTD::copy(__first, __middle, __b.begin());
+                _VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first));
                 break;
             }
             else
             {
-                __bit_iterator<_C, false> __mp = _STD::swap_ranges(__first, __middle, __middle);
+                __bit_iterator<_C, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle);
                 __first = __middle;
                 __middle = __mp;
                 __d2 -= __d1;
@@ -894,14 +894,14 @@
             if (__d2 <= __bit_array<_C>::capacity())
             {
                 __bit_array<_C> __b(__d2);
-                _STD::copy(__middle, __last, __b.begin());
-                _STD::copy_backward(__b.begin(), __b.end(), _STD::copy_backward(__first, __middle, __last));
+                _VSTD::copy(__middle, __last, __b.begin());
+                _VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last));
                 break;
             }
             else
             {
                 __bit_iterator<_C, false> __mp = __first + __d2;
-                _STD::swap_ranges(__first, __mp, __middle);
+                _VSTD::swap_ranges(__first, __mp, __middle);
                 __first = __mp;
                 __d1 -= __d2;
             }
@@ -928,12 +928,12 @@
         if (__first1.__ctz_ != 0)
         {
             unsigned __clz_f = __bits_per_word - __first1.__ctz_;
-            difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
             __storage_type __b = *__first1.__seg_ & __m;
             unsigned __clz_r = __bits_per_word - __first2.__ctz_;
-            __storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
+            __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
             __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
             if (__first2.__ctz_ > __first1.__ctz_)
                 if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_)))
@@ -972,7 +972,7 @@
         {
             __m = ~__storage_type(0) >> (__bits_per_word - __n);
             __storage_type __b = *__first1.__seg_ & __m;
-            __storage_type __dn = _STD::min(__n, static_cast<difference_type>(__clz_r));
+            __storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__clz_r));
             __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
             if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_))
                 return false;
@@ -1006,7 +1006,7 @@
         if (__first1.__ctz_ != 0)
         {
             unsigned __clz = __bits_per_word - __first1.__ctz_;
-            difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
+            difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
             if ((*__first2.__seg_ & __m) != (*__first1.__seg_ & __m))
diff --git a/include/__config b/include/__config
index a943274..b138510 100644
--- a/include/__config
+++ b/include/__config
@@ -169,7 +169,7 @@
 // Inline namespaces are available in Clang regardless of C++ dialect.
 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
 #define _LIBCPP_END_NAMESPACE_STD  } }
-#define _STD std::_LIBCPP_NAMESPACE
+#define _VSTD std::_LIBCPP_NAMESPACE
 
 namespace std {
   inline namespace _LIBCPP_NAMESPACE {
@@ -247,7 +247,7 @@
 
 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
 #define _LIBCPP_END_NAMESPACE_STD  } }
-#define _STD std::_LIBCPP_NAMESPACE
+#define _VSTD std::_LIBCPP_NAMESPACE
 
 namespace std {
 namespace _LIBCPP_NAMESPACE {
diff --git a/include/__functional_03 b/include/__functional_03
index 25d8ab9..e48bb68 100644
--- a/include/__functional_03
+++ b/include/__functional_03
@@ -314,8 +314,8 @@
 {
     __compressed_pair<_F, _Alloc> __f_;
 public:
-    explicit __func(_F __f) : __f_(_STD::move(__f)) {}
-    explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
+    explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
+    explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
     virtual __base<_R()>* __clone() const;
     virtual void __clone(__base<_R()>*) const;
     virtual void destroy();
@@ -396,9 +396,9 @@
 {
     __compressed_pair<_F, _Alloc> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
+    _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
-        : __f_(_STD::move(__f), _STD::move(__a)) {}
+        : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
     virtual __base<_R(_A0)>* __clone() const;
     virtual void __clone(__base<_R(_A0)>*) const;
     virtual void destroy();
@@ -479,9 +479,9 @@
 {
     __compressed_pair<_F, _Alloc> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
+    _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
-        : __f_(_STD::move(__f), _STD::move(__a)) {}
+        : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
     virtual __base<_R(_A0, _A1)>* __clone() const;
     virtual void __clone(__base<_R(_A0, _A1)>*) const;
     virtual void destroy();
@@ -562,9 +562,9 @@
 {
     __compressed_pair<_F, _Alloc> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
+    _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
-        : __f_(_STD::move(__f), _STD::move(__a)) {}
+        : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
     virtual __base<_R(_A0, _A1, _A2)>* __clone() const;
     virtual void __clone(__base<_R(_A0, _A1, _A2)>*) const;
     virtual void destroy();
@@ -831,7 +831,7 @@
 >::type
 function<_R()>::operator=(_F __f)
 {
-    function(_STD::move(__f)).swap(*this);
+    function(_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -878,7 +878,7 @@
         __f_ = (__base*)&__buf_;
     }
     else
-        _STD::swap(__f_, __f.__f_);
+        _VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _R>
@@ -1133,7 +1133,7 @@
 >::type
 function<_R(_A0)>::operator=(_F __f)
 {
-    function(_STD::move(__f)).swap(*this);
+    function(_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -1180,7 +1180,7 @@
         __f_ = (__base*)&__buf_;
     }
     else
-        _STD::swap(__f_, __f.__f_);
+        _VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _R, class _A0>
@@ -1435,7 +1435,7 @@
 >::type
 function<_R(_A0, _A1)>::operator=(_F __f)
 {
-    function(_STD::move(__f)).swap(*this);
+    function(_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -1482,7 +1482,7 @@
         __f_ = (__base*)&__buf_;
     }
     else
-        _STD::swap(__f_, __f.__f_);
+        _VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _R, class _A0, class _A1>
@@ -1737,7 +1737,7 @@
 >::type
 function<_R(_A0, _A1, _A2)>::operator=(_F __f)
 {
-    function(_STD::move(__f)).swap(*this);
+    function(_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -1784,7 +1784,7 @@
         __f_ = (__base*)&__buf_;
     }
     else
-        _STD::swap(__f_, __f.__f_);
+        _VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _R, class _A0, class _A1, class _A2>
@@ -1909,7 +1909,7 @@
 typename __mu_return1<true, _Ti, _Uj...>::type
 __mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>)
 {
-    __ti(_STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
+    __ti(_VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
 }
 
 template <class _Ti, class ..._Uj>
@@ -1947,7 +1947,7 @@
     // compiler bug workaround
     typename tuple_element<_Indx, _Uj>::type __t = get<_Indx>(__uj);
     return __t;
-//    return _STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
+//    return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
 }
 
 template <class _Ti, class _Uj>
@@ -2051,8 +2051,8 @@
 public:
     template <class _G, class ..._BA>
       explicit __bind(_G&& __f, _BA&& ...__bound_args)
-        : __f_(_STD::forward<_G>(__f)),
-          __bound_args_(_STD::forward<_BA>(__bound_args)...) {}
+        : __f_(_VSTD::forward<_G>(__f)),
+          __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
 
     template <class ..._Args>
         typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
@@ -2085,21 +2085,21 @@
 
     template <class _G, class ..._BA>
       explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
-        : base(_STD::forward<_G>(__f),
-               _STD::forward<_BA>(__bound_args)...) {}
+        : base(_VSTD::forward<_G>(__f),
+               _VSTD::forward<_BA>(__bound_args)...) {}
 
     template <class ..._Args>
         result_type
         operator()(_Args&& ...__args)
         {
-            return base::operator()(_STD::forward<_Args>(__args)...);
+            return base::operator()(_VSTD::forward<_Args>(__args)...);
         }
 
     template <class ..._Args>
         result_type
         operator()(_Args&& ...__args) const
         {
-            return base::operator()(_STD::forward<_Args>(__args)...);
+            return base::operator()(_VSTD::forward<_Args>(__args)...);
         }
 };
 
@@ -2112,7 +2112,7 @@
 bind(_F&& __f, _BoundArgs&&... __bound_args)
 {
     typedef __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
-    return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
+    return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
 }
 
 template<class _R, class _F, class ..._BoundArgs>
@@ -2121,7 +2121,7 @@
 bind(_F&& __f, _BoundArgs&&... __bound_args)
 {
     typedef __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
-    return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
+    return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
 }
 */
 
diff --git a/include/__functional_base b/include/__functional_base
index f2aa504..441ab4f 100644
--- a/include/__functional_base
+++ b/include/__functional_base
@@ -287,18 +287,18 @@
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
-    -> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...))
+    -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
 {
-    return (_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...);
+    return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _F, class _A0, class ..._Args>
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
-    -> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...))
+    -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
 {
-    return ((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...);
+    return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...);
 }
 
 // bullets 3 and 4
@@ -307,18 +307,18 @@
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_F&& __f, _A0&& __a0)
-    -> decltype(_STD::forward<_A0>(__a0).*__f)
+    -> decltype(_VSTD::forward<_A0>(__a0).*__f)
 {
-    return _STD::forward<_A0>(__a0).*__f;
+    return _VSTD::forward<_A0>(__a0).*__f;
 }
 
 template <class _F, class _A0>
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_F&& __f, _A0&& __a0)
-    -> decltype((*_STD::forward<_A0>(__a0)).*__f)
+    -> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
 {
-    return (*_STD::forward<_A0>(__a0)).*__f;
+    return (*_VSTD::forward<_A0>(__a0)).*__f;
 }
 
 // bullet 5
@@ -327,15 +327,15 @@
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_F&& __f, _Args&& ...__args)
-    -> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...))
+    -> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...))
 {
-    return _STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...);
+    return _VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _Tp, class ..._Args>
 struct __invoke_return
 {
-    typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_Args>()...)) type;
+    typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
 };
 
 template <class _Tp>
@@ -365,7 +365,7 @@
        typename __invoke_of<type&, _ArgTypes...>::type
           operator() (_ArgTypes&&... __args) const
           {
-              return __invoke(get(), _STD::forward<_ArgTypes>(__args)...);
+              return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
           }
 };
 
diff --git a/include/__functional_base_03 b/include/__functional_base_03
index 7fed6c7..fabda5b 100644
--- a/include/__functional_base_03
+++ b/include/__functional_base_03
@@ -842,7 +842,7 @@
 template <class _T1, class _R>
 struct __4th_helper<_T1, _R, true>
 {
-    typedef typename __apply_cv<decltype(*_STD::declval<_T1>()), _R>::type type;
+    typedef typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _R>::type type;
 };
 
 template <class _R, class _T, class _T1>
@@ -959,13 +959,13 @@
 template <class _F>
 struct __invoke_return<_F, false>
 {
-    typedef decltype(__invoke(_STD::declval<_F>())) type;
+    typedef decltype(__invoke(_VSTD::declval<_F>())) type;
 };
 
 template <class _Tp, class _A0>
 struct __invoke_return0
 {
-    typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>())) type;
+    typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>())) type;
 };
 
 template <class _R, class _T, class _A0>
@@ -983,16 +983,16 @@
 template <class _Tp, class _A0, class _A1>
 struct __invoke_return1
 {
-    typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>(),
-                                                    _STD::declval<_A1>())) type;
+    typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
+                                                    _VSTD::declval<_A1>())) type;
 };
 
 template <class _Tp, class _A0, class _A1, class _A2>
 struct __invoke_return2
 {
-    typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>(),
-                                                    _STD::declval<_A1>(),
-                                                    _STD::declval<_A2>())) type;
+    typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
+                                                    _VSTD::declval<_A1>(),
+                                                    _VSTD::declval<_A2>())) type;
 };
 
 template <class _Tp>
diff --git a/include/__hash_table b/include/__hash_table
index b185cde..8efec22 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -86,7 +86,7 @@
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _STD::addressof(__node_->__value_);}
+        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_iterator& operator++()
@@ -164,7 +164,7 @@
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _STD::addressof(__node_->__value_);}
+        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_iterator& operator++()
@@ -388,7 +388,7 @@
     _LIBCPP_INLINE_VISIBILITY
     __bucket_list_deallocator(__bucket_list_deallocator&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-        : __data_(_STD::move(__x.__data_))
+        : __data_(_VSTD::move(__x.__data_))
     {
         __x.size() = 0;
     }
@@ -441,7 +441,7 @@
     void operator()(pointer __p) _NOEXCEPT
     {
         if (__value_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -688,7 +688,7 @@
         return __bc != 0 ? (float)size() / __bc : 0.f;
     }
     _LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
-        {max_load_factor() = _STD::max(__mlf, load_factor());}
+        {max_load_factor() = _VSTD::max(__mlf, load_factor());}
 
     _LIBCPP_INLINE_VISIBILITY local_iterator       begin(size_type __n)
         {return local_iterator(__bucket_list_[__n], __n, bucket_count());}
@@ -741,8 +741,8 @@
             is_nothrow_move_assignable<__node_allocator>::value)
     {
         __bucket_list_.get_deleter().__alloc() =
-                _STD::move(__u.__bucket_list_.get_deleter().__alloc());
-        __node_alloc() = _STD::move(__u.__node_alloc());
+                _VSTD::move(__u.__bucket_list_.get_deleter().__alloc());
+        __node_alloc() = _VSTD::move(__u.__node_alloc());
     }
     _LIBCPP_INLINE_VISIBILITY
         void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
@@ -769,7 +769,7 @@
     __swap_alloc(_A& __x, _A& __y, true_type)
         _NOEXCEPT_(__is_nothrow_swappable<_A>::value)
     {
-        using _STD::swap;
+        using _VSTD::swap;
         swap(__x, __y);
     }
 
@@ -859,15 +859,15 @@
             is_nothrow_move_constructible<__first_node>::value &&
             is_nothrow_move_constructible<hasher>::value &&
             is_nothrow_move_constructible<key_equal>::value)
-    : __bucket_list_(_STD::move(__u.__bucket_list_)),
-      __p1_(_STD::move(__u.__p1_)),
-      __p2_(_STD::move(__u.__p2_)),
-      __p3_(_STD::move(__u.__p3_))
+    : __bucket_list_(_VSTD::move(__u.__bucket_list_)),
+      __p1_(_VSTD::move(__u.__p1_)),
+      __p2_(_VSTD::move(__u.__p2_)),
+      __p3_(_VSTD::move(__u.__p3_))
 {
     if (size() > 0)
     {
         __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
-            static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -878,8 +878,8 @@
                                                        const allocator_type& __a)
     : __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
       __p1_(__node_allocator(__a)),
-      __p2_(0, _STD::move(__u.hash_function())),
-      __p3_(_STD::move(__u.__p3_))
+      __p2_(0, _VSTD::move(__u.hash_function())),
+      __p3_(_VSTD::move(__u.__p3_))
 {
     if (__a == allocator_type(__u.__node_alloc()))
     {
@@ -891,7 +891,7 @@
             __p1_.first().__next_ = __u.__p1_.first().__next_;
             __u.__p1_.first().__next_ = nullptr;
             __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
-                static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
+                static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
             size() = __u.size();
             __u.size() = 0;
         }
@@ -945,7 +945,7 @@
     while (__np != nullptr)
     {
         __node_pointer __next = __np->__next_;
-        __node_traits::destroy(__na, _STD::addressof(__np->__value_));
+        __node_traits::destroy(__na, _VSTD::addressof(__np->__value_));
         __node_traits::deallocate(__na, __np, 1);
         __np = __next;
     }
@@ -981,14 +981,14 @@
     __u.__bucket_list_.get_deleter().size() = 0;
     __move_assign_alloc(__u);
     size() = __u.size();
-    hash_function() = _STD::move(__u.hash_function());
+    hash_function() = _VSTD::move(__u.hash_function());
     max_load_factor() = __u.max_load_factor();
-    key_eq() = _STD::move(__u.key_eq());
+    key_eq() = _VSTD::move(__u.key_eq());
     __p1_.first().__next_ = __u.__p1_.first().__next_;
     if (size() > 0)
     {
         __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
-            static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -1003,8 +1003,8 @@
         __move_assign(__u, true_type());
     else
     {
-        hash_function() = _STD::move(__u.hash_function());
-        key_eq() = _STD::move(__u.key_eq());
+        hash_function() = _VSTD::move(__u.hash_function());
+        key_eq() = _VSTD::move(__u.key_eq());
         max_load_factor() = __u.max_load_factor();
         if (bucket_count() != 0)
         {
@@ -1016,7 +1016,7 @@
                 const_iterator __i = __u.begin();
                 while (__cache != nullptr && __u.size() != 0)
                 {
-                    __cache->__value_ = _STD::move(__u.remove(__i++)->__value_);
+                    __cache->__value_ = _VSTD::move(__u.remove(__i++)->__value_);
                     __node_pointer __next = __cache->__next_;
                     __node_insert_multi(__cache);
                     __cache = __next;
@@ -1035,7 +1035,7 @@
         while (__u.size() != 0)
         {
             __node_holder __h =
-                    __construct_node(_STD::move(__u.remove(__i++)->__value_));
+                    __construct_node(_VSTD::move(__u.remove(__i++)->__value_));
             __node_insert_multi(__h.get());
             __h.release();
         }
@@ -1201,7 +1201,7 @@
     {
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
         {
-            rehash(_STD::max<size_type>(2 * __bc + 1,
+            rehash(_VSTD::max<size_type>(2 * __bc + 1,
                            size_type(ceil(float(size() + 1) / max_load_factor()))));
             __bc = bucket_count();
             __chash = __nd->__hash_ % __bc;
@@ -1210,7 +1210,7 @@
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
             __nd->__next_ = __pn->__next_;
             __pn->__next_ = __nd;
             // fix up __bucket_list_
@@ -1240,7 +1240,7 @@
     size_type __bc = bucket_count();
     if (size()+1 > __bc * max_load_factor() || __bc == 0)
     {
-        rehash(_STD::max<size_type>(2 * __bc + 1,
+        rehash(_VSTD::max<size_type>(2 * __bc + 1,
                        size_type(ceil(float(size() + 1) / max_load_factor()))));
         __bc = bucket_count();
     }
@@ -1248,7 +1248,7 @@
     __node_pointer __pn = __bucket_list_[__chash];
     if (__pn == nullptr)
     {
-        __pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
+        __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
         __cp->__next_ = __pn->__next_;
         __pn->__next_ = __cp;
         // fix up __bucket_list_
@@ -1301,7 +1301,7 @@
         size_type __bc = bucket_count();
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
         {
-            rehash(_STD::max<size_type>(2 * __bc + 1,
+            rehash(_VSTD::max<size_type>(2 * __bc + 1,
                            size_type(ceil(float(size() + 1) / max_load_factor()))));
             __bc = bucket_count();
         }
@@ -1345,7 +1345,7 @@
         __node_holder __h = __construct_node(__x, __hash);
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
         {
-            rehash(_STD::max<size_type>(2 * __bc + 1,
+            rehash(_VSTD::max<size_type>(2 * __bc + 1,
                            size_type(ceil(float(size() + 1) / max_load_factor()))));
             __bc = bucket_count();
             __chash = __hash % __bc;
@@ -1354,7 +1354,7 @@
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
             __h->__next_ = __pn->__next_;
             __pn->__next_ = __h.get();
             // fix up __bucket_list_
@@ -1384,7 +1384,7 @@
 pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     pair<iterator, bool> __r = __node_insert_unique(__h.get());
     if (__r.second)
         __h.release();
@@ -1396,7 +1396,7 @@
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_multi(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     iterator __r = __node_insert_multi(__h.get());
     __h.release();
     return __r;
@@ -1408,7 +1408,7 @@
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
         const_iterator __p, _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     iterator __r = __node_insert_multi(__p, __h.get());
     __h.release();
     return __r;
@@ -1421,7 +1421,7 @@
 pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_P&& __x)
 {
-    __node_holder __h = __construct_node(_STD::forward<_P>(__x));
+    __node_holder __h = __construct_node(_VSTD::forward<_P>(__x));
     pair<iterator, bool> __r = __node_insert_unique(__h.get());
     if (__r.second)
         __h.release();
@@ -1437,7 +1437,7 @@
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(_P&& __x)
 {
-    __node_holder __h = __construct_node(_STD::forward<_P>(__x));
+    __node_holder __h = __construct_node(_VSTD::forward<_P>(__x));
     iterator __r = __node_insert_multi(__h.get());
     __h.release();
     return __r;
@@ -1449,7 +1449,7 @@
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
                                                          _P&& __x)
 {
-    __node_holder __h = __construct_node(_STD::forward<_P>(__x));
+    __node_holder __h = __construct_node(_VSTD::forward<_P>(__x));
     iterator __r = __node_insert_multi(__p, __h.get());
     __h.release();
     return __r;
@@ -1484,13 +1484,13 @@
 void
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n)
 {
-    __n = __next_prime(_STD::max<size_type>(__n, size() > 0));
+    __n = __next_prime(_VSTD::max<size_type>(__n, size() > 0));
     size_type __bc = bucket_count();
     if (__n > __bc)
         __rehash(__n);
     else
     {
-        __n = _STD::max<size_type>
+        __n = _VSTD::max<size_type>
               (
                   __n,
                   __next_prime(size_t(ceil(float(size()) / max_load_factor())))
@@ -1512,7 +1512,7 @@
     {
         for (size_type __i = 0; __i < __nbc; ++__i)
             __bucket_list_[__i] = nullptr;
-        __node_pointer __pp(static_cast<__node_pointer>(_STD::addressof(__p1_.first())));
+        __node_pointer __pp(static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())));
         __node_pointer __cp = __pp->__next_;
         if (__cp != nullptr)
         {
@@ -1612,7 +1612,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = hash_function()(__h->__value_);
     __h->__next_ = nullptr;
@@ -1628,11 +1628,11 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::move(__v));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = __hash;
     __h->__next_ = nullptr;
-    return _STD::move(__h);
+    return _VSTD::move(__h);
 }
 
 #else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1643,11 +1643,11 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = hash_function()(__h->__value_);
     __h->__next_ = nullptr;
-    return _STD::move(__h);
+    return _VSTD::move(__h);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1659,11 +1659,11 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = __hash;
     __h->__next_ = nullptr;
-    return _STD::move(__h);
+    return _VSTD::move(__h);
 }
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1737,7 +1737,7 @@
     // Fix up __bucket_list_
         // if __pn is not in same bucket (before begin is not in same bucket) &&
         //    if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
-    if (__pn == _STD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash)
+    if (__pn == _VSTD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash)
     {
         if (__cn->__next_ == nullptr || __cn->__next_->__hash_ % __bc != __chash)
             __bucket_list_[__chash] = nullptr;
@@ -1868,19 +1868,19 @@
     __bucket_list_.reset(__u.__bucket_list_.release());
     __u.__bucket_list_.reset(__npp);
     }
-    _STD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
+    _VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
     __swap_alloc(__bucket_list_.get_deleter().__alloc(),
              __u.__bucket_list_.get_deleter().__alloc());
     __swap_alloc(__node_alloc(), __u.__node_alloc());
-    _STD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
+    _VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
     __p2_.swap(__u.__p2_);
     __p3_.swap(__u.__p3_);
     if (size() > 0)
         __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
-            static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
     if (__u.size() > 0)
         __u.__bucket_list_[__u.__p1_.first().__next_->__hash_ % __u.bucket_count()] =
-            static_cast<__node_pointer>(_STD::addressof(__u.__p1_.first()));
+            static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first()));
 }
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
diff --git a/include/__locale b/include/__locale
index 21a5734..6103409 100644
--- a/include/__locale
+++ b/include/__locale
@@ -137,10 +137,10 @@
 locale::combine(const locale& __other) const
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
-    if (!_STD::has_facet<_Facet>(__other))
+    if (!_VSTD::has_facet<_Facet>(__other))
         throw runtime_error("locale::combine: locale missing facet");
 #endif  // _LIBCPP_NO_EXCEPTIONS
-    return locale(*this, &const_cast<_Facet&>(_STD::use_facet<_Facet>(__other)));
+    return locale(*this, &const_cast<_Facet&>(_VSTD::use_facet<_Facet>(__other)));
 }
 
 template <class _Facet>
@@ -292,7 +292,7 @@
 locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
                    const basic_string<_CharT, _Traits, _Allocator>& __y) const
 {
-    return _STD::use_facet<_STD::collate<_CharT> >(*this).compare(
+    return _VSTD::use_facet<_VSTD::collate<_CharT> >(*this).compare(
                                        __x.data(), __x.data() + __x.size(),
                                        __y.data(), __y.data() + __y.size()) < 0;
 }
diff --git a/include/__mutex_base b/include/__mutex_base
index 6f98d2e..9e472fc 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -190,8 +190,8 @@
     _LIBCPP_INLINE_VISIBILITY
     void swap(unique_lock& __u)
     {
-        _STD::swap(__m_, __u.__m_);
-        _STD::swap(__owns_, __u.__owns_);
+        _VSTD::swap(__m_, __u.__m_);
+        _VSTD::swap(__owns_, __u.__owns_);
     }
     _LIBCPP_INLINE_VISIBILITY
     mutex_type* release()
@@ -429,7 +429,7 @@
                              _Predicate __pred)
 {
     return wait_until(__lk, chrono::steady_clock::now() + __d,
-                      _STD::move(__pred));
+                      _VSTD::move(__pred));
 }
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/include/__split_buffer b/include/__split_buffer
index 7c22e48..73d9f35 100644
--- a/include/__split_buffer
+++ b/include/__split_buffer
@@ -144,7 +144,7 @@
     void __move_assign_alloc(const __split_buffer& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
-            __alloc() = _STD::move(__c.__alloc());
+            __alloc() = _VSTD::move(__c.__alloc());
         }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -162,7 +162,7 @@
     static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, true_type)
         _NOEXCEPT_(__is_nothrow_swappable<__alloc_rr>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
 
@@ -208,7 +208,7 @@
     __alloc_rr& __a = this->__alloc();
     do
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), value_type());
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), value_type());
         ++this->__end_;
         --__n;
     } while (__n > 0);
@@ -227,7 +227,7 @@
     __alloc_rr& __a = this->__alloc();
     do
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), __x);
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), __x);
         ++this->__end_;
         --__n;
     } while (__n > 0);
@@ -249,14 +249,14 @@
         if (__end_ == __end_cap())
         {
             size_type __old_cap = __end_cap() - __first_;
-            size_type __new_cap = _STD::max<size_type>(2 * __old_cap, 8);
+            size_type __new_cap = _VSTD::max<size_type>(2 * __old_cap, 8);
             __split_buffer __buf(__new_cap, 0, __a);
             for (pointer __p = __begin_; __p != __end_; ++__p, ++__buf.__end_)
                 __alloc_traits::construct(__buf.__alloc(),
-                        _STD::__to_raw_pointer(__buf.__end_), _STD::move(*__p));
+                        _VSTD::__to_raw_pointer(__buf.__end_), _VSTD::move(*__p));
             swap(__buf);
         }
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
         ++this->__end_;
     }
 }
@@ -273,7 +273,7 @@
     __alloc_rr& __a = this->__alloc();
     for (; __first != __last; ++__first)
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
         ++this->__end_;
     }
 }
@@ -356,10 +356,10 @@
 template <class _Tp, class _Allocator>
 __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
     _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-    : __first_(_STD::move(__c.__first_)),
-      __begin_(_STD::move(__c.__begin_)),
-      __end_(_STD::move(__c.__end_)),
-      __end_cap_(_STD::move(__c.__end_cap_))
+    : __first_(_VSTD::move(__c.__first_)),
+      __begin_(_VSTD::move(__c.__begin_)),
+      __end_(_VSTD::move(__c.__end_)),
+      __end_cap_(_VSTD::move(__c.__end_cap_))
 {
     __c.__first_ = nullptr;
     __c.__begin_ = nullptr;
@@ -421,10 +421,10 @@
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
                    __is_nothrow_swappable<__alloc_rr>::value)
 {
-    _STD::swap(__first_, __x.__first_);
-    _STD::swap(__begin_, __x.__begin_);
-    _STD::swap(__end_, __x.__end_);
-    _STD::swap(__end_cap(), __x.__end_cap());
+    _VSTD::swap(__first_, __x.__first_);
+    _VSTD::swap(__begin_, __x.__begin_);
+    _VSTD::swap(__end_, __x.__end_);
+    _VSTD::swap(__end_cap(), __x.__end_cap());
     __swap_alloc(__alloc(), __x.__alloc());
 }
 
@@ -437,10 +437,10 @@
         __split_buffer<value_type, __alloc_rr&> __t(__n, 0, __alloc());
         __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                move_iterator<pointer>(__end_));
-        _STD::swap(__first_, __t.__first_);
-        _STD::swap(__begin_, __t.__begin_);
-        _STD::swap(__end_, __t.__end_);
-        _STD::swap(__end_cap(), __t.__end_cap());
+        _VSTD::swap(__first_, __t.__first_);
+        _VSTD::swap(__begin_, __t.__begin_);
+        _VSTD::swap(__end_, __t.__end_);
+        _VSTD::swap(__end_cap(), __t.__end_cap());
     }
 }
 
@@ -458,10 +458,10 @@
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
             __t.__end_ = __t.__begin_ + (__end_ - __begin_);
-            _STD::swap(__first_, __t.__first_);
-            _STD::swap(__begin_, __t.__begin_);
-            _STD::swap(__end_, __t.__end_);
-            _STD::swap(__end_cap(), __t.__end_cap());
+            _VSTD::swap(__first_, __t.__first_);
+            _VSTD::swap(__begin_, __t.__begin_);
+            _VSTD::swap(__end_, __t.__end_);
+            _VSTD::swap(__end_cap(), __t.__end_cap());
 #ifndef _LIBCPP_NO_EXCEPTIONS
         }
         catch (...)
@@ -481,7 +481,7 @@
         {
             difference_type __d = __end_cap() - __end_;
             __d = (__d + 1) / 2;
-            __begin_ = _STD::move_backward(__begin_, __end_, __end_ + __d);
+            __begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
             __end_ += __d;
         }
         else
@@ -490,13 +490,13 @@
             __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _STD::swap(__first_, __t.__first_);
-            _STD::swap(__begin_, __t.__begin_);
-            _STD::swap(__end_, __t.__end_);
-            _STD::swap(__end_cap(), __t.__end_cap());
+            _VSTD::swap(__first_, __t.__first_);
+            _VSTD::swap(__begin_, __t.__begin_);
+            _VSTD::swap(__end_, __t.__end_);
+            _VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__begin_-1), __x);
+    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__begin_-1), __x);
     --__begin_;
 }
 
@@ -512,7 +512,7 @@
         {
             difference_type __d = __end_cap() - __end_;
             __d = (__d + 1) / 2;
-            __begin_ = _STD::move_backward(__begin_, __end_, __end_ + __d);
+            __begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
             __end_ += __d;
         }
         else
@@ -521,14 +521,14 @@
             __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _STD::swap(__first_, __t.__first_);
-            _STD::swap(__begin_, __t.__begin_);
-            _STD::swap(__end_, __t.__end_);
-            _STD::swap(__end_cap(), __t.__end_cap());
+            _VSTD::swap(__first_, __t.__first_);
+            _VSTD::swap(__begin_, __t.__begin_);
+            _VSTD::swap(__end_, __t.__end_);
+            _VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__begin_-1),
-            _STD::move(__x));
+    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__begin_-1),
+            _VSTD::move(__x));
     --__begin_;
 }
 
@@ -545,7 +545,7 @@
         {
             difference_type __d = __begin_ - __first_;
             __d = (__d + 1) / 2;
-            __end_ = _STD::move(__begin_, __end_, __begin_ - __d);
+            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
             __begin_ -= __d;
         }
         else
@@ -554,13 +554,13 @@
             __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _STD::swap(__first_, __t.__first_);
-            _STD::swap(__begin_, __t.__begin_);
-            _STD::swap(__end_, __t.__end_);
-            _STD::swap(__end_cap(), __t.__end_cap());
+            _VSTD::swap(__first_, __t.__first_);
+            _VSTD::swap(__begin_, __t.__begin_);
+            _VSTD::swap(__end_, __t.__end_);
+            _VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_), __x);
+    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_), __x);
     ++__end_;
 }
 
@@ -576,7 +576,7 @@
         {
             difference_type __d = __begin_ - __first_;
             __d = (__d + 1) / 2;
-            __end_ = _STD::move(__begin_, __end_, __begin_ - __d);
+            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
             __begin_ -= __d;
         }
         else
@@ -585,14 +585,14 @@
             __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _STD::swap(__first_, __t.__first_);
-            _STD::swap(__begin_, __t.__begin_);
-            _STD::swap(__end_, __t.__end_);
-            _STD::swap(__end_cap(), __t.__end_cap());
+            _VSTD::swap(__first_, __t.__first_);
+            _VSTD::swap(__begin_, __t.__begin_);
+            _VSTD::swap(__end_, __t.__end_);
+            _VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_),
-            _STD::move(__x));
+    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
+            _VSTD::move(__x));
     ++__end_;
 }
 
@@ -609,7 +609,7 @@
         {
             difference_type __d = __begin_ - __first_;
             __d = (__d + 1) / 2;
-            __end_ = _STD::move(__begin_, __end_, __begin_ - __d);
+            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
             __begin_ -= __d;
         }
         else
@@ -618,14 +618,14 @@
             __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _STD::swap(__first_, __t.__first_);
-            _STD::swap(__begin_, __t.__begin_);
-            _STD::swap(__end_, __t.__end_);
-            _STD::swap(__end_cap(), __t.__end_cap());
+            _VSTD::swap(__first_, __t.__first_);
+            _VSTD::swap(__begin_, __t.__begin_);
+            _VSTD::swap(__end_, __t.__end_);
+            _VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_),
-                              _STD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
+                              _VSTD::forward<_Args>(__args)...);
     ++__end_;
 }
 
diff --git a/include/__std_stream b/include/__std_stream
index 7dfb0c9..6ab0fd6 100644
--- a/include/__std_stream
+++ b/include/__std_stream
@@ -97,7 +97,7 @@
 __stdinbuf<_CharT>::__getchar(bool __consume)
 {
     char __extbuf[__limit];
-    int __nread = _STD::max(1, __encoding_);
+    int __nread = _VSTD::max(1, __encoding_);
     for (int __i = 0; __i < __nread; ++__i)
     {
         char __c = getc(__file_);
@@ -120,7 +120,7 @@
                                    &__1buf, &__1buf + 1, __inxt);
             switch (__r)
             {
-            case _STD::codecvt_base::ok:
+            case _VSTD::codecvt_base::ok:
                 break;
             case codecvt_base::partial:
                 __st_ = __sv_st;
@@ -136,11 +136,11 @@
                 break;
             case codecvt_base::error:
                 return traits_type::eof();
-            case _STD::codecvt_base::noconv:
+            case _VSTD::codecvt_base::noconv:
                 __1buf = static_cast<char_type>(__extbuf[0]);
                 break;
             }
-        } while (__r == _STD::codecvt_base::partial);
+        } while (__r == _VSTD::codecvt_base::partial);
     }
     if (!__consume)
     {
@@ -166,9 +166,9 @@
     switch (__cv_->out(__st_, &__ci, &__ci + 1, __inxt,
                               __extbuf, __extbuf + sizeof(__extbuf), __enxt))
     {
-    case _STD::codecvt_base::ok:
+    case _VSTD::codecvt_base::ok:
         break;
-    case _STD::codecvt_base::noconv:
+    case _VSTD::codecvt_base::noconv:
         __extbuf[0] = static_cast<char>(__c);
         __enxt = __extbuf + 1;
         break;
diff --git a/include/__tree b/include/__tree
index 676819b..6c4b6e6 100644
--- a/include/__tree
+++ b/include/__tree
@@ -529,7 +529,7 @@
     void operator()(pointer __p) _NOEXCEPT
     {
         if (__value_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -604,7 +604,7 @@
     template <class ..._Args>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tree_node(_Args&& ...__args)
-            : __value_(_STD::forward<_Args>(__args)...) {}
+            : __value_(_VSTD::forward<_Args>(__args)...) {}
 #else  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     explicit __tree_node(const value_type& __v)
@@ -1075,7 +1075,7 @@
     _LIBCPP_INLINE_VISIBILITY
     void __move_assign_alloc(__tree& __t, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
-        {__node_alloc() = _STD::move(__t.__node_alloc());}
+        {__node_alloc() = _VSTD::move(__t.__node_alloc());}
     _LIBCPP_INLINE_VISIBILITY
     void __move_assign_alloc(__tree& __t, false_type) _NOEXCEPT {}
 
@@ -1090,7 +1090,7 @@
     static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
         _NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
     _LIBCPP_INLINE_VISIBILITY
@@ -1284,9 +1284,9 @@
     _NOEXCEPT_(
         is_nothrow_move_constructible<__node_allocator>::value &&
         is_nothrow_move_constructible<value_compare>::value)
-    : __begin_node_(_STD::move(__t.__begin_node_)),
-      __pair1_(_STD::move(__t.__pair1_)),
-      __pair3_(_STD::move(__t.__pair3_))
+    : __begin_node_(_VSTD::move(__t.__begin_node_)),
+      __pair1_(_VSTD::move(__t.__pair1_)),
+      __pair3_(_VSTD::move(__t.__pair3_))
 {
     if (size() == 0)
         __begin_node() = __end_node();
@@ -1302,7 +1302,7 @@
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
     : __pair1_(__node_allocator(__a)),
-      __pair3_(0, _STD::move(__t.value_comp()))
+      __pair3_(0, _VSTD::move(__t.value_comp()))
 {
     if (__a == __t.__alloc())
     {
@@ -1335,7 +1335,7 @@
     __begin_node_ = __t.__begin_node_;
     __pair1_.first() = __t.__pair1_.first();
     __move_assign_alloc(__t);
-    __pair3_ = _STD::move(__t.__pair3_);
+    __pair3_ = _VSTD::move(__t.__pair3_);
     if (size() == 0)
         __begin_node() = __end_node();
     else
@@ -1355,7 +1355,7 @@
         __move_assign(__t, true_type());
     else
     {
-        value_comp() = _STD::move(__t.value_comp());
+        value_comp() = _VSTD::move(__t.value_comp());
         const_iterator __e = end();
         if (size() != 0)
         {
@@ -1366,7 +1366,7 @@
 #endif  // _LIBCPP_NO_EXCEPTIONS
                 while (__cache != nullptr && __t.size() != 0)
                 {
-                    __cache->__value_ = _STD::move(__t.remove(__t.begin())->__value_);
+                    __cache->__value_ = _VSTD::move(__t.remove(__t.begin())->__value_);
                     __node_pointer __next = __detach(__cache);
                     __node_insert_multi(__cache);
                     __cache = __next;
@@ -1389,7 +1389,7 @@
             }
         }
         while (__t.size() != 0)
-            __insert_multi(__e, _STD::move(__t.remove(__t.begin())->__value_));
+            __insert_multi(__e, _VSTD::move(__t.remove(__t.begin())->__value_));
     }
 }
 
@@ -1424,7 +1424,7 @@
         destroy(static_cast<__node_pointer>(__nd->__left_));
         destroy(static_cast<__node_pointer>(__nd->__right_));
         __node_allocator& __na = __node_alloc();
-        __node_traits::destroy(__na, _STD::addressof(__nd->__value_));
+        __node_traits::destroy(__na, _VSTD::addressof(__nd->__value_));
         __node_traits::deallocate(__na, __nd, 1);
     }
 }
@@ -1437,7 +1437,7 @@
         (!__node_traits::propagate_on_container_swap::value ||
          __is_nothrow_swappable<__node_allocator>::value))
 {
-    using _STD::swap;
+    using _VSTD::swap;
     swap(__begin_node_, __t.__begin_node_);
     swap(__pair1_.first(), __t.__pair1_.first());
     __swap_alloc(__node_alloc(), __t.__node_alloc());
@@ -1661,10 +1661,10 @@
     else if (value_comp()(*__hint, __v))  // check after
     {
         // *__hint < __v
-        const_iterator __next = _STD::next(__hint);
+        const_iterator __next = _VSTD::next(__hint);
         if (__next == end() || value_comp()(__v, *__next))
         {
-            // *__hint < __v < *_STD::next(__hint)
+            // *__hint < __v < *_VSTD::next(__hint)
             if (__hint.__ptr_->__right_ == nullptr)
             {
                 __parent = const_cast<__node_pointer&>(__hint.__ptr_);
@@ -1710,7 +1710,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__value_constructed = true;
     return __h;
 }
@@ -1720,7 +1720,7 @@
 pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
 __tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_equal(__parent, __h->__value_);
     __node_pointer __r = static_cast<__node_pointer>(__child);
@@ -1739,7 +1739,7 @@
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique(const_iterator __p, _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_equal(__p, __parent, __h->__value_);
     __node_pointer __r = static_cast<__node_pointer>(__child);
@@ -1756,7 +1756,7 @@
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
     __insert_node_at(__parent, __child, __h.get());
@@ -1769,7 +1769,7 @@
 __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
                                                         _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
     __insert_node_at(__parent, __child, __h.get());
@@ -1783,7 +1783,7 @@
 pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
 __tree<_Tp, _Compare, _Allocator>::__insert_unique(_V&& __v)
 {
-    __node_holder __h = __construct_node(_STD::forward<_V>(__v));
+    __node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
     pair<iterator, bool> __r = __node_insert_unique(__h.get());
     if (__r.second)
         __h.release();
@@ -1795,7 +1795,7 @@
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _V&& __v)
 {
-    __node_holder __h = __construct_node(_STD::forward<_V>(__v));
+    __node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
     iterator __r = __node_insert_unique(__p, __h.get());
     if (__r.__ptr_ == __h.get())
         __h.release();
@@ -1807,7 +1807,7 @@
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__insert_multi(_V&& __v)
 {
-    __node_holder __h = __construct_node(_STD::forward<_V>(__v));
+    __node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
     __insert_node_at(__parent, __child, __h.get());
@@ -1819,7 +1819,7 @@
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _V&& __v)
 {
-    __node_holder __h = __construct_node(_STD::forward<_V>(__v));
+    __node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
     __insert_node_at(__parent, __child, __h.get());
@@ -1834,9 +1834,9 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
     __h.get_deleter().__value_constructed = true;
-    return _STD::move(__h);
+    return _VSTD::move(__h);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1962,7 +1962,7 @@
         __begin_node() = __r.__ptr_;
     --size();
     __node_allocator& __na = __node_alloc();
-    __node_traits::destroy(__na, const_cast<value_type*>(_STD::addressof(*__p)));
+    __node_traits::destroy(__na, const_cast<value_type*>(_VSTD::addressof(*__p)));
     __tree_remove(__end_node()->__left_,
                   static_cast<__node_base_pointer>(__np));
     __node_traits::deallocate(__na, __np, 1);
@@ -2064,7 +2064,7 @@
         else if (value_comp()(__rt->__value_, __k))
             __rt = static_cast<__node_const_pointer>(__rt->__right_);
         else
-            return _STD::distance(
+            return _VSTD::distance(
                 __lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt),
                 __upper_bound(__k, static_cast<__node_const_pointer>(__rt->__right_), __result)
             );
diff --git a/include/algorithm b/include/algorithm
index 4789b0b..3e0938f 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -757,7 +757,7 @@
 {
     for (; __first != __last; ++__first)
         __f(*__first);
-    return _STD::move(__f);
+    return _VSTD::move(__f);
 }
 
 // find
@@ -929,7 +929,7 @@
 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
          _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
 {
-    return _STD::__find_end<typename add_lvalue_reference<_BinaryPredicate>::type>
+    return _VSTD::__find_end<typename add_lvalue_reference<_BinaryPredicate>::type>
                          (__first1, __last1, __first2, __last2, __pred,
                           typename iterator_traits<_ForwardIterator1>::iterator_category(),
                           typename iterator_traits<_ForwardIterator2>::iterator_category());
@@ -943,7 +943,7 @@
 {
     typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
     typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
-    return _STD::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+    return _VSTD::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
 }
 
 // find_first_of
@@ -968,7 +968,7 @@
 {
     typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
     typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
-    return _STD::find_first_of(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+    return _VSTD::find_first_of(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
 }
 
 // adjacent_find
@@ -997,7 +997,7 @@
 adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
 {
     typedef typename iterator_traits<_ForwardIterator>::value_type __v;
-    return _STD::adjacent_find(__first, __last, __equal_to<__v>());
+    return _VSTD::adjacent_find(__first, __last, __equal_to<__v>());
 }
 
 // count
@@ -1049,7 +1049,7 @@
 {
     typedef typename iterator_traits<_InputIterator1>::value_type __v1;
     typedef typename iterator_traits<_InputIterator2>::value_type __v2;
-    return _STD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+    return _VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>());
 }
 
 // equal
@@ -1072,7 +1072,7 @@
 {
     typedef typename iterator_traits<_InputIterator1>::value_type __v1;
     typedef typename iterator_traits<_InputIterator2>::value_type __v2;
-    return _STD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+    return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
 }
 
 // is_permutation
@@ -1090,10 +1090,10 @@
 __not_done:
     // __first1 != __last1 && *__first1 != *__first2
     typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
-    _D1 __l1 = _STD::distance(__first1, __last1);
+    _D1 __l1 = _VSTD::distance(__first1, __last1);
     if (__l1 == _D1(1))
         return false;
-    _ForwardIterator2 __last2 = _STD::next(__first2, __l1);
+    _ForwardIterator2 __last2 = _VSTD::next(__first2, __l1);
     // For each element in [f1, l1) see if there are the same number of
     //    equal elements in [f2, l2)
     for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)
@@ -1112,7 +1112,7 @@
                 return false;
             // Count number of *__i in [__i, l1) (we can start with 1)
             _D1 __c1 = 1;
-            for (_ForwardIterator1 __j = _STD::next(__i); __j != __last1; ++__j)
+            for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)
                 if (__pred(*__i, *__j))
                     ++__c1;
             if (__c1 != __c2)
@@ -1131,7 +1131,7 @@
 {
     typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
     typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
-    return _STD::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+    return _VSTD::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>());
 }
 
 // search
@@ -1291,7 +1291,7 @@
 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
        _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
 {
-    return _STD::__search<typename add_lvalue_reference<_BinaryPredicate>::type>
+    return _VSTD::__search<typename add_lvalue_reference<_BinaryPredicate>::type>
                          (__first1, __last1, __first2, __last2, __pred,
                           typename std::iterator_traits<_ForwardIterator1>::iterator_category(),
                           typename std::iterator_traits<_ForwardIterator2>::iterator_category());
@@ -1305,7 +1305,7 @@
 {
     typedef typename std::iterator_traits<_ForwardIterator1>::value_type __v1;
     typedef typename std::iterator_traits<_ForwardIterator2>::value_type __v2;
-    return _STD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+    return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
 }
 
 // search_n
@@ -1393,7 +1393,7 @@
 search_n(_ForwardIterator __first, _ForwardIterator __last,
          _Size __count, const _Tp& __value, _BinaryPredicate __pred)
 {
-    return _STD::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type>
+    return _VSTD::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type>
            (__first, __last, __count, __value, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
 }
 
@@ -1403,7 +1403,7 @@
 search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value)
 {
     typedef typename iterator_traits<_ForwardIterator>::value_type __v;
-    return _STD::search_n(__first, __last, __count, __value, __equal_to<__v, _Tp>());
+    return _VSTD::search_n(__first, __last, __count, __value, __equal_to<__v, _Tp>());
 }
 
 // copy
@@ -1479,7 +1479,7 @@
 __copy(_Tp* __first, _Tp* __last, _Up* __result)
 {
     const size_t __n = static_cast<size_t>(__last - __first);
-    _STD::memmove(__result, __first, __n * sizeof(_Up));
+    _VSTD::memmove(__result, __first, __n * sizeof(_Up));
     return __result + __n;
 }
 
@@ -1488,7 +1488,7 @@
 _OutputIterator
 copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
-    return _STD::__copy(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
+    return _VSTD::__copy(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
 }
 
 // copy_backward
@@ -1515,7 +1515,7 @@
 {
     const size_t __n = static_cast<size_t>(__last - __first);
     __result -= __n;
-    _STD::memmove(__result, __first, __n * sizeof(_Up));
+    _VSTD::memmove(__result, __first, __n * sizeof(_Up));
     return __result;
 }
 
@@ -1525,7 +1525,7 @@
 copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
               _BidirectionalIterator2 __result)
 {
-    return _STD::__copy_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
+    return _VSTD::__copy_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
 }
 
 // copy_if
@@ -1582,7 +1582,7 @@
 >::type
 copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
 {
-    return _STD::copy(__first, __first + __n, __result);
+    return _VSTD::copy(__first, __first + __n, __result);
 }
 
 // move
@@ -1593,7 +1593,7 @@
 __move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
     for (; __first != __last; ++__first, ++__result)
-        *__result = _STD::move(*__first);
+        *__result = _VSTD::move(*__first);
     return __result;
 }
 
@@ -1608,7 +1608,7 @@
 __move(_Tp* __first, _Tp* __last, _Up* __result)
 {
     const size_t __n = static_cast<size_t>(__last - __first);
-    _STD::memmove(__result, __first, __n * sizeof(_Up));
+    _VSTD::memmove(__result, __first, __n * sizeof(_Up));
     return __result + __n;
 }
 
@@ -1617,7 +1617,7 @@
 _OutputIterator
 move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
-    return _STD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
+    return _VSTD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
 }
 
 // move_backward
@@ -1628,7 +1628,7 @@
 __move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
     while (__first != __last)
-        *--__result = _STD::move(*--__last);
+        *--__result = _VSTD::move(*--__last);
     return __result;
 }
 
@@ -1644,7 +1644,7 @@
 {
     const size_t __n = static_cast<size_t>(__last - __first);
     __result -= __n;
-    _STD::memmove(__result, __first, __n * sizeof(_Up));
+    _VSTD::memmove(__result, __first, __n * sizeof(_Up));
     return __result;
 }
 
@@ -1654,7 +1654,7 @@
 move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
               _BidirectionalIterator2 __result)
 {
-    return _STD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
+    return _VSTD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
 }
 
 // iter_swap
@@ -1758,7 +1758,7 @@
 __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value, true_type)
 {
     if (__n > 0)
-        _STD::memset(__first, (unsigned char)__value, (size_t)(__n));
+        _VSTD::memset(__first, (unsigned char)__value, (size_t)(__n));
     return __first + __n;
 }
 
@@ -1767,7 +1767,7 @@
 _OutputIterator
 fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
 {
-   return _STD::__fill_n(__first, __n, __value, integral_constant<bool,
+   return _VSTD::__fill_n(__first, __n, __value, integral_constant<bool,
                                               is_pointer<_OutputIterator>::value &&
                                               is_trivially_copy_assignable<_Tp>::value     &&
                                               sizeof(_Tp) == 1>());
@@ -1789,7 +1789,7 @@
 void
 __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value, random_access_iterator_tag)
 {
-    _STD::fill_n(__first, __last - __first, __value);
+    _VSTD::fill_n(__first, __last - __first, __value);
 }
 
 template <class _ForwardIterator, class _Tp>
@@ -1797,7 +1797,7 @@
 void
 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    _STD::__fill(__first, __last, __value, typename iterator_traits<_ForwardIterator>::iterator_category());
+    _VSTD::__fill(__first, __last, __value, typename iterator_traits<_ForwardIterator>::iterator_category());
 }
 
 // generate
@@ -1829,7 +1829,7 @@
 _ForwardIterator
 remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    __first = _STD::find(__first, __last, __value);
+    __first = _VSTD::find(__first, __last, __value);
     if (__first != __last)
     {
         _ForwardIterator __i = __first;
@@ -1837,7 +1837,7 @@
         {
             if (!(*__i == __value))
             {
-                *__first = _STD::move(*__i);
+                *__first = _VSTD::move(*__i);
                 ++__first;
             }
         }
@@ -1851,7 +1851,7 @@
 _ForwardIterator
 remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
 {
-    __first = _STD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type>
+    __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type>
                            (__first, __last, __pred);
     if (__first != __last)
     {
@@ -1860,7 +1860,7 @@
         {
             if (!__pred(*__i))
             {
-                *__first = _STD::move(*__i);
+                *__first = _VSTD::move(*__i);
                 ++__first;
             }
         }
@@ -1910,7 +1910,7 @@
 _ForwardIterator
 unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
 {
-    __first = _STD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type>
+    __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type>
                                  (__first, __last, __pred);
     if (__first != __last)
     {
@@ -1919,7 +1919,7 @@
         _ForwardIterator __i = __first;
         for (++__i; ++__i != __last;)
             if (!__pred(*__first, *__i))
-                *++__first = _STD::move(*__i);
+                *++__first = _VSTD::move(*__i);
         ++__first;
     }
     return __first;
@@ -1931,7 +1931,7 @@
 unique(_ForwardIterator __first, _ForwardIterator __last)
 {
     typedef typename iterator_traits<_ForwardIterator>::value_type __v;
-    return _STD::unique(__first, __last, __equal_to<__v>());
+    return _VSTD::unique(__first, __last, __equal_to<__v>());
 }
 
 // unique_copy
@@ -2003,7 +2003,7 @@
 _OutputIterator
 unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred)
 {
-    return _STD::__unique_copy<typename add_lvalue_reference<_BinaryPredicate>::type>
+    return _VSTD::__unique_copy<typename add_lvalue_reference<_BinaryPredicate>::type>
                               (__first, __last, __result, __pred,
                                typename iterator_traits<_InputIterator>::iterator_category(),
                                typename iterator_traits<_OutputIterator>::iterator_category());
@@ -2015,7 +2015,7 @@
 unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
     typedef typename iterator_traits<_InputIterator>::value_type __v;
-    return _STD::unique_copy(__first, __last, __result, __equal_to<__v>());
+    return _VSTD::unique_copy(__first, __last, __result, __equal_to<__v>());
 }
 
 // reverse
@@ -2049,7 +2049,7 @@
 void
 reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
 {
-    _STD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category());
+    _VSTD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category());
 }
 
 // reverse_copy
@@ -2134,7 +2134,7 @@
     const difference_type __m2 = __last - __middle;
     if (__m1 == __m2)
     {
-        _STD::swap_ranges(__first, __middle, __middle);
+        _VSTD::swap_ranges(__first, __middle, __middle);
         return __middle;
     }
     const difference_type __g = __gcd(__m1, __m2);
@@ -2163,7 +2163,7 @@
 _ForwardIterator
 rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
 {
-    return _STD::__rotate(__first, __middle, __last,
+    return _VSTD::__rotate(__first, __middle, __last,
                           integral_constant
                           <
                                bool,
@@ -2186,7 +2186,7 @@
 _OutputIterator
 rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)
 {
-    return _STD::copy(__first, __middle, _STD::copy(__middle, __last, __result));
+    return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result));
 }
 
 // min_element
@@ -2211,7 +2211,7 @@
 _ForwardIterator
 min_element(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _STD::min_element(__first, __last,
+    return _VSTD::min_element(__first, __last,
               __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
@@ -2230,7 +2230,7 @@
 const _Tp&
 min(const _Tp& __a, const _Tp& __b)
 {
-    return _STD::min(__a, __b, __less<_Tp>());
+    return _VSTD::min(__a, __b, __less<_Tp>());
 }
 
 template<class _Tp, class _Compare>
@@ -2238,7 +2238,7 @@
 _Tp
 min(initializer_list<_Tp> __t, _Compare __comp)
 {
-    return *_STD::min_element(__t.begin(), __t.end(), __comp);
+    return *_VSTD::min_element(__t.begin(), __t.end(), __comp);
 }
 
 template<class _Tp>
@@ -2246,7 +2246,7 @@
 _Tp
 min(initializer_list<_Tp> __t)
 {
-    return *_STD::min_element(__t.begin(), __t.end());
+    return *_VSTD::min_element(__t.begin(), __t.end());
 }
 
 // max_element
@@ -2271,7 +2271,7 @@
 _ForwardIterator
 max_element(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _STD::max_element(__first, __last,
+    return _VSTD::max_element(__first, __last,
               __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
@@ -2290,7 +2290,7 @@
 const _Tp&
 max(const _Tp& __a, const _Tp& __b)
 {
-    return _STD::max(__a, __b, __less<_Tp>());
+    return _VSTD::max(__a, __b, __less<_Tp>());
 }
 
 template<class _Tp, class _Compare>
@@ -2298,7 +2298,7 @@
 _Tp
 max(initializer_list<_Tp> __t, _Compare __comp)
 {
-    return *_STD::max_element(__t.begin(), __t.end(), __comp);
+    return *_VSTD::max_element(__t.begin(), __t.end(), __comp);
 }
 
 template<class _Tp>
@@ -2306,7 +2306,7 @@
 _Tp
 max(initializer_list<_Tp> __t)
 {
-    return *_STD::max_element(__t.begin(), __t.end());
+    return *_VSTD::max_element(__t.begin(), __t.end());
 }
 
 // minmax_element
@@ -2366,7 +2366,7 @@
 std::pair<_ForwardIterator, _ForwardIterator>
 minmax_element(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _STD::minmax_element(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+    return _VSTD::minmax_element(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
 // minmax
@@ -2385,7 +2385,7 @@
 pair<const _Tp&, const _Tp&>
 minmax(const _Tp& __a, const _Tp& __b)
 {
-    return _STD::minmax(__a, __b, __less<_Tp>());
+    return _VSTD::minmax(__a, __b, __less<_Tp>());
 }
 
 template<class _Tp>
@@ -2394,7 +2394,7 @@
 minmax(initializer_list<_Tp> __t)
 {
     pair<const _Tp*, const _Tp*> __p =
-                                   _STD::minmax_element(__t.begin(), __t.end());
+                                   _VSTD::minmax_element(__t.begin(), __t.end());
     return pair<_Tp, _Tp>(*__p.first, *__p.second);
 }
 
@@ -2404,7 +2404,7 @@
 minmax(initializer_list<_Tp> __t, _Compare __comp)
 {
     pair<const _Tp*, const _Tp*> __p =
-                           _STD::minmax_element(__t.begin(), __t.end(), __comp);
+                           _VSTD::minmax_element(__t.begin(), __t.end(), __comp);
     return pair<_Tp, _Tp>(*__p.first, *__p.second);
 }
 
@@ -2810,7 +2810,7 @@
 _ForwardIterator
 partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
 {
-    return _STD::__partition<typename add_lvalue_reference<_Predicate>::type>
+    return _VSTD::__partition<typename add_lvalue_reference<_Predicate>::type>
                             (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
 }
 
@@ -2846,12 +2846,12 @@
 partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
 {
     typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
-    difference_type __len = _STD::distance(__first, __last);
+    difference_type __len = _VSTD::distance(__first, __last);
     while (__len != 0)
     {
         difference_type __l2 = __len / 2;
         _ForwardIterator __m = __first;
-        _STD::advance(__m, __l2);
+        _VSTD::advance(__m, __l2);
         if (__pred(*__m))
         {
             __first = ++__m;
@@ -2892,7 +2892,7 @@
         // Move the falses into the temporary buffer, and the trues to the front of the line
         // Update __first to always point to the end of the trues
         value_type* __t = __p.first;
-        ::new(__t) value_type(_STD::move(*__first));
+        ::new(__t) value_type(_VSTD::move(*__first));
         __d.__incr((value_type*)0);
         ++__t;
         _ForwardIterator __i = __first;
@@ -2900,12 +2900,12 @@
         {
             if (__pred(*__i))
             {
-                *__first = _STD::move(*__i);
+                *__first = _VSTD::move(*__i);
                 ++__first;
             }
             else
             {
-                ::new(__t) value_type(_STD::move(*__i));
+                ::new(__t) value_type(_VSTD::move(*__i));
                 __d.__incr((value_type*)0);
                 ++__t;
             }
@@ -2914,7 +2914,7 @@
         // Move falses back into range, but don't mess up __first which points to first false
         __i = __first;
         for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, ++__i)
-            *__i = _STD::move(*__t2);
+            *__i = _VSTD::move(*__t2);
         // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer
         return __first;
     }
@@ -2922,7 +2922,7 @@
     // __len >= 3
     _ForwardIterator __m = __first;
     _Distance __len2 = __len / 2;  // __len2 >= 2
-    _STD::advance(__m, __len2);
+    _VSTD::advance(__m, __len2);
     // recurse on [__first, __m), *__first know to be false
     // F?????????????????
     // f       m         l
@@ -2946,7 +2946,7 @@
 __second_half_done:
     // TTTFFFFFTTTTTFFFFF
     // f  ff   m    sf   l
-    return _STD::rotate(__first_false, __m, __second_false);
+    return _VSTD::rotate(__first_false, __m, __second_false);
     // TTTTTTTTFFFFFFFFFF
     //         |
 }
@@ -2954,7 +2954,7 @@
 struct __return_temporary_buffer
 {
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_STD::return_temporary_buffer(__p);}
+    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);}
 };
 
 template <class _Predicate, class _ForwardIterator>
@@ -2976,12 +2976,12 @@
     // *__first is known to be false
     typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
     typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
-    difference_type __len = _STD::distance(__first, __last);
+    difference_type __len = _VSTD::distance(__first, __last);
     pair<value_type*, ptrdiff_t> __p(0, 0);
     unique_ptr<value_type, __return_temporary_buffer> __h;
     if (__len >= __alloc_limit)
     {
-        __p = _STD::get_temporary_buffer<value_type>(__len);
+        __p = _VSTD::get_temporary_buffer<value_type>(__len);
         __h.reset(__p.first);
     }
     return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
@@ -3022,7 +3022,7 @@
         // Move the falses into the temporary buffer, and the trues to the front of the line
         // Update __first to always point to the end of the trues
         value_type* __t = __p.first;
-        ::new(__t) value_type(_STD::move(*__first));
+        ::new(__t) value_type(_VSTD::move(*__first));
         __d.__incr((value_type*)0);
         ++__t;
         _BidirectionalIterator __i = __first;
@@ -3030,23 +3030,23 @@
         {
             if (__pred(*__i))
             {
-                *__first = _STD::move(*__i);
+                *__first = _VSTD::move(*__i);
                 ++__first;
             }
             else
             {
-                ::new(__t) value_type(_STD::move(*__i));
+                ::new(__t) value_type(_VSTD::move(*__i));
                 __d.__incr((value_type*)0);
                 ++__t;
             }
         }
         // move *__last, known to be true
-        *__first = _STD::move(*__i);
+        *__first = _VSTD::move(*__i);
         __i = ++__first;
         // All trues now at start of range, all falses in buffer
         // Move falses back into range, but don't mess up __first which points to first false
         for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, ++__i)
-            *__i = _STD::move(*__t2);
+            *__i = _VSTD::move(*__t2);
         // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer
         return __first;
     }
@@ -3054,7 +3054,7 @@
     // __len >= 4
     _BidirectionalIterator __m = __first;
     _Distance __len2 = __len / 2;  // __len2 >= 2
-    _STD::advance(__m, __len2);
+    _VSTD::advance(__m, __len2);
     // recurse on [__first, __m-1], except reduce __m-1 until *(__m-1) is true, *__first know to be false
     // F????????????????T
     // f       m        l
@@ -3091,7 +3091,7 @@
 __second_half_done:
     // TTTFFFFFTTTTTFFFFF
     // f  ff   m    sf  l
-    return _STD::rotate(__first_false, __m, __second_false);
+    return _VSTD::rotate(__first_false, __m, __second_false);
     // TTTTTTTTFFFFFFFFFF
     //         |
 }
@@ -3124,12 +3124,12 @@
     // *__first is known to be false
     // *__last is known to be true
     // __len >= 2
-    difference_type __len = _STD::distance(__first, __last) + 1;
+    difference_type __len = _VSTD::distance(__first, __last) + 1;
     pair<value_type*, ptrdiff_t> __p(0, 0);
     unique_ptr<value_type, __return_temporary_buffer> __h;
     if (__len >= __alloc_limit)
     {
-        __p = _STD::get_temporary_buffer<value_type>(__len);
+        __p = _VSTD::get_temporary_buffer<value_type>(__len);
         __h.reset(__p.first);
     }
     return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
@@ -3169,7 +3169,7 @@
 _ForwardIterator
 is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _STD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+    return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
 // is_sorted
@@ -3179,7 +3179,7 @@
 bool
 is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
-    return _STD::is_sorted_until(__first, __last, __comp) == __last;
+    return _VSTD::is_sorted_until(__first, __last, __comp) == __last;
 }
 
 template<class _ForwardIterator>
@@ -3187,7 +3187,7 @@
 bool
 is_sorted(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _STD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+    return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
 // sort
@@ -3294,7 +3294,7 @@
     _BirdirectionalIterator __lm1 = __last;
     for (--__lm1; __first != __lm1; ++__first)
     {
-        _BirdirectionalIterator __i = _STD::min_element<_BirdirectionalIterator,
+        _BirdirectionalIterator __i = _VSTD::min_element<_BirdirectionalIterator,
                                                         typename add_lvalue_reference<_Compare>::type>
                                                        (__first, __last, __comp);
         if (__i != __first)
@@ -3313,10 +3313,10 @@
         for (++__i; __i != __last; ++__i)
         {
             _BirdirectionalIterator __j = __i;
-            value_type __t(_STD::move(*__j));
+            value_type __t(_VSTD::move(*__j));
             for (_BirdirectionalIterator __k = __i; __k != __first && __comp(__t,  *--__k); --__j)
-                *__j = _STD::move(*__k);
-            *__j = _STD::move(__t);
+                *__j = _VSTD::move(*__k);
+            *__j = _VSTD::move(__t);
         }
     }
 }
@@ -3332,15 +3332,15 @@
     {
         if (__comp(*__i, *__j))
         {
-            value_type __t(_STD::move(*__i));
+            value_type __t(_VSTD::move(*__i));
             _RandomAccessIterator __k = __j;
             __j = __i;
             do
             {
-                *__j = _STD::move(*__k);
+                *__j = _VSTD::move(*__k);
                 __j = __k;
             } while (__j != __first && __comp(__t, *--__k));
-            *__j = _STD::move(__t);
+            *__j = _VSTD::move(__t);
         }
         __j = __i;
     }
@@ -3360,13 +3360,13 @@
             swap(*__first, *__last);
         return true;
     case 3:
-        _STD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
+        _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
         return true;
     case 4:
-        _STD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
+        _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
         return true;
     case 5:
-        _STD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
+        _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
         return true;
     }
     typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
@@ -3378,15 +3378,15 @@
     {
         if (__comp(*__i, *__j))
         {
-            value_type __t(_STD::move(*__i));
+            value_type __t(_VSTD::move(*__i));
             _RandomAccessIterator __k = __j;
             __j = __i;
             do
             {
-                *__j = _STD::move(*__k);
+                *__j = _VSTD::move(*__k);
                 __j = __k;
             } while (__j != __first && __comp(__t, *--__k));
-            *__j = _STD::move(__t);
+            *__j = _VSTD::move(__t);
             if (++__count == __limit)
                 return ++__i == __last;
         }
@@ -3406,7 +3406,7 @@
         __destruct_n __d(0);
         unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
         value_type* __last2 = __first2;
-        ::new(__last2) value_type(_STD::move(*__first1));
+        ::new(__last2) value_type(_VSTD::move(*__first1));
         __d.__incr((value_type*)0);
         for (++__last2; ++__first1 != __last1; ++__last2)
         {
@@ -3414,15 +3414,15 @@
             value_type* __i2 = __j2;
             if (__comp(*__first1, *--__i2))
             {
-                ::new(__j2) value_type(_STD::move(*__i2));
+                ::new(__j2) value_type(_VSTD::move(*__i2));
                 __d.__incr((value_type*)0);
                 for (--__j2; __i2 != __first2 && __comp(*__first1,  *--__i2); --__j2)
-                    *__j2 = _STD::move(*__i2);
-                *__j2 = _STD::move(*__first1);
+                    *__j2 = _VSTD::move(*__i2);
+                *__j2 = _VSTD::move(*__first1);
             }
             else
             {
-                ::new(__j2) value_type(_STD::move(*__first1));
+                ::new(__j2) value_type(_VSTD::move(*__first1));
                 __d.__incr((value_type*)0);
             }
         }
@@ -3453,18 +3453,18 @@
                 swap(*__first, *__last);
             return;
         case 3:
-            _STD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
+            _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
             return;
         case 4:
-            _STD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
+            _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
             return;
         case 5:
-            _STD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
+            _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
             return;
         }
         if (__len <= __limit)
         {
-            _STD::__insertion_sort_3<_Compare>(__first, __last, __comp);
+            _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
             return;
         }
         // __len > 5
@@ -3479,13 +3479,13 @@
             __delta = __len/2;
             __m += __delta;
             __delta /= 2;
-            __n_swaps = _STD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp);
+            __n_swaps = _VSTD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp);
         }
         else
         {
             __delta = __len/2;
             __m += __delta;
-            __n_swaps = _STD::__sort3<_Compare>(__first, __m, __lm1, __comp);
+            __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, __lm1, __comp);
         }
         }
         // *__m is median
@@ -3541,7 +3541,7 @@
                     }
                     // [__first, __i) == *__first and *__first < [__i, __last)
                     // The first part is sorted, sort the secod part
-                    // _STD::__sort<_Compare>(__i, __last, __comp);
+                    // _VSTD::__sort<_Compare>(__i, __last, __comp);
                     __first = __i;
                     goto __restart;
                 }
@@ -3590,8 +3590,8 @@
         // If we were given a perfect partition, see if insertion sort is quick...
         if (__n_swaps == 0)
         {
-            bool __fs = _STD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
-            if (_STD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp))
+            bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
+            if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp))
             {
                 if (__fs)
                     return;
@@ -3610,14 +3610,14 @@
         // sort smaller range with recursive call and larger with tail recursion elimination
         if (__i - __first < __last - __i)
         {
-            _STD::__sort<_Compare>(__first, __i, __comp);
-            // _STD::__sort<_Compare>(__i+1, __last, __comp);
+            _VSTD::__sort<_Compare>(__first, __i, __comp);
+            // _VSTD::__sort<_Compare>(__i+1, __last, __comp);
             __first = ++__i;
         }
         else
         {
-            _STD::__sort<_Compare>(__i+1, __last, __comp);
-            // _STD::__sort<_Compare>(__first, __i, __comp);
+            _VSTD::__sort<_Compare>(__i+1, __last, __comp);
+            // _VSTD::__sort<_Compare>(__first, __i, __comp);
             __last = __i;
         }
     }
@@ -3644,7 +3644,7 @@
 void
 sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    _STD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    _VSTD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 template <class _Tp>
@@ -3652,7 +3652,7 @@
 void
 sort(_Tp** __first, _Tp** __last)
 {
-    _STD::sort((size_t*)__first, (size_t*)__last, __less<size_t>());
+    _VSTD::sort((size_t*)__first, (size_t*)__last, __less<size_t>());
 }
 
 template <class _Tp>
@@ -3660,7 +3660,7 @@
 void
 sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last)
 {
-    _STD::sort(__first.base(), __last.base());
+    _VSTD::sort(__first.base(), __last.base());
 }
 
 extern template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
@@ -3704,12 +3704,12 @@
 __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
 {
     typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
-    difference_type __len = _STD::distance(__first, __last);
+    difference_type __len = _VSTD::distance(__first, __last);
     while (__len != 0)
     {
         difference_type __l2 = __len / 2;
         _ForwardIterator __m = __first;
-        _STD::advance(__m, __l2);
+        _VSTD::advance(__m, __l2);
         if (__comp(*__m, __value))
         {
             __first = ++__m;
@@ -3741,7 +3741,7 @@
 _ForwardIterator
 lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    return _STD::lower_bound(__first, __last, __value,
+    return _VSTD::lower_bound(__first, __last, __value,
                              __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
 }
 
@@ -3752,12 +3752,12 @@
 __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
 {
     typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
-    difference_type __len = _STD::distance(__first, __last);
+    difference_type __len = _VSTD::distance(__first, __last);
     while (__len != 0)
     {
         difference_type __l2 = __len / 2;
         _ForwardIterator __m = __first;
-        _STD::advance(__m, __l2);
+        _VSTD::advance(__m, __l2);
         if (__comp(__value, *__m))
             __len = __l2;
         else
@@ -3789,7 +3789,7 @@
 _ForwardIterator
 upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    return _STD::upper_bound(__first, __last, __value,
+    return _VSTD::upper_bound(__first, __last, __value,
                              __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
@@ -3800,12 +3800,12 @@
 __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
 {
     typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
-    difference_type __len = _STD::distance(__first, __last);
+    difference_type __len = _VSTD::distance(__first, __last);
     while (__len != 0)
     {
         difference_type __l2 = __len / 2;
         _ForwardIterator __m = __first;
-        _STD::advance(__m, __l2);
+        _VSTD::advance(__m, __l2);
         if (__comp(*__m, __value))
         {
             __first = ++__m;
@@ -3849,7 +3849,7 @@
 pair<_ForwardIterator, _ForwardIterator>
 equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    return _STD::equal_range(__first, __last, __value,
+    return _VSTD::equal_range(__first, __last, __value,
                              __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
 }
 
@@ -3884,7 +3884,7 @@
 bool
 binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    return _STD::binary_search(__first, __last, __value,
+    return _VSTD::binary_search(__first, __last, __value,
                              __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
 }
 
@@ -3898,7 +3898,7 @@
     for (; __first1 != __last1; ++__result)
     {
         if (__first2 == __last2)
-            return _STD::copy(__first1, __last1, __result);
+            return _VSTD::copy(__first1, __last1, __result);
         if (__comp(*__first2, *__first1))
         {
             *__result = *__first2;
@@ -3910,7 +3910,7 @@
             ++__first1;
         }
     }
-    return _STD::copy(__first2, __last2, __result);
+    return _VSTD::copy(__first2, __last2, __result);
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
@@ -3922,10 +3922,10 @@
 #ifdef _LIBCPP_DEBUG
     typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;
     __debug_less<_Compare> __c(__comp);
-    return _STD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c);
+    return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c);
 #else  // _LIBCPP_DEBUG
     typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
-    return _STD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
+    return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
 #endif  // _LIBCPP_DEBUG
 }
 
@@ -3958,7 +3958,7 @@
     {
         value_type* __p = __buff;
         for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), ++__i, ++__p)
-            ::new(__p) value_type(_STD::move(*__i));
+            ::new(__p) value_type(_VSTD::move(*__i));
         __merge<_Compare>(move_iterator<value_type*>(__buff),
                           move_iterator<value_type*>(__p),
                           move_iterator<_BidirectionalIterator>(__middle),
@@ -3969,7 +3969,7 @@
     {
         value_type* __p = __buff;
         for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), ++__i, ++__p)
-            ::new(__p) value_type(_STD::move(*__i));
+            ::new(__p) value_type(_VSTD::move(*__i));
         typedef reverse_iterator<_BidirectionalIterator> _RBi;
         typedef reverse_iterator<value_type*> _Rv;
         __merge(move_iterator<_RBi>(_RBi(__middle)), move_iterator<_RBi>(_RBi(__first)),
@@ -4022,9 +4022,9 @@
         {   // __len >= 1, __len2 >= 2
             __len21 = __len2 / 2;
             __m2 = __middle;
-            _STD::advance(__m2, __len21);
+            _VSTD::advance(__m2, __len21);
             __m1 = __upper_bound<_Compare>(__first, __middle, *__m2, __comp);
-            __len11 = _STD::distance(__first, __m1);
+            __len11 = _VSTD::distance(__first, __m1);
         }
         else
         {
@@ -4037,15 +4037,15 @@
             // __len1 >= 2, __len2 >= 1
             __len11 = __len1 / 2;
             __m1 = __first;
-            _STD::advance(__m1, __len11);
+            _VSTD::advance(__m1, __len11);
             __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp);
-            __len21 = _STD::distance(__middle, __m2);
+            __len21 = _VSTD::distance(__middle, __m2);
         }
         difference_type __len12 = __len1 - __len11;  // distance(__m1, __middle)
         difference_type __len22 = __len2 - __len21;  // distance(__m2, __last)
         // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last)
         // swap middle two partitions
-        __middle = _STD::rotate(__m1, __middle, __m2);
+        __middle = _VSTD::rotate(__m1, __middle, __m2);
         // __len12 and __len21 now have swapped meanings
         // merge smaller range with recurisve call and larger with tail recursion elimination
         if (__len11 + __len21 < __len12 + __len22)
@@ -4083,24 +4083,24 @@
 {
     typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
     typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
-    difference_type __len1 = _STD::distance(__first, __middle);
-    difference_type __len2 = _STD::distance(__middle, __last);
-    difference_type __buf_size = _STD::min(__len1, __len2);
+    difference_type __len1 = _VSTD::distance(__first, __middle);
+    difference_type __len2 = _VSTD::distance(__middle, __last);
+    difference_type __buf_size = _VSTD::min(__len1, __len2);
     pair<value_type*, ptrdiff_t> __buf(0, 0);
     unique_ptr<value_type, __return_temporary_buffer> __h;
     if (__inplace_merge_switch<value_type>::value && __buf_size > 8)
     {
-        __buf = _STD::get_temporary_buffer<value_type>(__buf_size);
+        __buf = _VSTD::get_temporary_buffer<value_type>(__buf_size);
         __h.reset(__buf.first);
     }
 #ifdef _LIBCPP_DEBUG
     typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;
     __debug_less<_Compare> __c(__comp);
-    return _STD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __c, __len1, __len2,
+    return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __c, __len1, __len2,
                                             __buf.first, __buf.second);
 #else  // _LIBCPP_DEBUG
     typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
-    return _STD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2,
+    return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2,
                                             __buf.first, __buf.second);
 #endif  // _LIBCPP_DEBUG
 }
@@ -4110,7 +4110,7 @@
 void
 inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)
 {
-    _STD::inplace_merge(__first, __middle, __last,
+    _VSTD::inplace_merge(__first, __middle, __last,
                         __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
 }
 
@@ -4130,26 +4130,26 @@
         if (__first1 == __last1)
         {
             for (; __first2 != __last2; ++__first2, ++__result, __d.__incr((value_type*)0))
-                ::new (__result) value_type(_STD::move(*__first2));
+                ::new (__result) value_type(_VSTD::move(*__first2));
             __h.release();
             return;
         }
         if (__first2 == __last2)
         {
             for (; __first1 != __last1; ++__first1, ++__result, __d.__incr((value_type*)0))
-                ::new (__result) value_type(_STD::move(*__first1));
+                ::new (__result) value_type(_VSTD::move(*__first1));
             __h.release();
             return;
         }
         if (__comp(*__first2, *__first1))
         {
-            ::new (__result) value_type(_STD::move(*__first2));
+            ::new (__result) value_type(_VSTD::move(*__first2));
             __d.__incr((value_type*)0);
             ++__first2;
         }
         else
         {
-            ::new (__result) value_type(_STD::move(*__first1));
+            ::new (__result) value_type(_VSTD::move(*__first1));
             __d.__incr((value_type*)0);
             ++__first1;
         }
@@ -4167,22 +4167,22 @@
         if (__first2 == __last2)
         {
             for (; __first1 != __last1; ++__first1, ++__result)
-                *__result = _STD::move(*__first1);
+                *__result = _VSTD::move(*__first1);
             return;
         }
         if (__comp(*__first2, *__first1))
         {
-            *__result = _STD::move(*__first2);
+            *__result = _VSTD::move(*__first2);
             ++__first2;
         }
         else
         {
-            *__result = _STD::move(*__first1);
+            *__result = _VSTD::move(*__first1);
             ++__first1;
         }
     }
     for (; __first2 != __last2; ++__first2, ++__result)
-        *__result = _STD::move(*__first2);
+        *__result = _VSTD::move(*__first2);
 }
 
 template <class _Compare, class _RandomAccessIterator>
@@ -4203,24 +4203,24 @@
     case 0:
         return;
     case 1:
-        ::new(__first2) value_type(_STD::move(*__first1));
+        ::new(__first2) value_type(_VSTD::move(*__first1));
         return;
     case 2:
        __destruct_n __d(0);
         unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);
          if (__comp(*--__last1, *__first1))
         {
-            ::new(__first2) value_type(_STD::move(*__last1));
+            ::new(__first2) value_type(_VSTD::move(*__last1));
             __d.__incr((value_type*)0);
             ++__first2;
-            ::new(__first2) value_type(_STD::move(*__first1));
+            ::new(__first2) value_type(_VSTD::move(*__first1));
         }
         else
         {
-            ::new(__first2) value_type(_STD::move(*__first1));
+            ::new(__first2) value_type(_VSTD::move(*__first1));
             __d.__incr((value_type*)0);
             ++__first2;
-            ::new(__first2) value_type(_STD::move(*__last1));
+            ::new(__first2) value_type(_VSTD::move(*__last1));
         }
         __h2.release();
         return;
@@ -4301,7 +4301,7 @@
     unique_ptr<value_type, __return_temporary_buffer> __h;
     if (__len > static_cast<difference_type>(__stable_sort_switch<value_type>::value))
     {
-        __buf = _STD::get_temporary_buffer<value_type>(__len);
+        __buf = _VSTD::get_temporary_buffer<value_type>(__len);
         __h.reset(__buf.first);
     }
 #ifdef _LIBCPP_DEBUG
@@ -4319,7 +4319,7 @@
 void
 stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    _STD::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    _VSTD::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // is_heap_until
@@ -4328,7 +4328,7 @@
 _RandomAccessIterator
 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 {
-    typedef typename _STD::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+    typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
     difference_type __len = __last - __first;
     difference_type __p = 0;
     difference_type __c = 1;
@@ -4356,7 +4356,7 @@
 _RandomAccessIterator
 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    return _STD::is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    return _VSTD::is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // is_heap
@@ -4366,7 +4366,7 @@
 bool
 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 {
-    return _STD::is_heap_until(__first, __last, __comp) == __last;
+    return _VSTD::is_heap_until(__first, __last, __comp) == __last;
 }
 
 template<class _RandomAccessIterator>
@@ -4374,7 +4374,7 @@
 bool
 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    return _STD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // push_heap
@@ -4399,10 +4399,10 @@
         }
         if (__comp(*__pp, *__cp))
         {
-            value_type __t(_STD::move(*__pp));
+            value_type __t(_VSTD::move(*__pp));
             do
             {
-                *__pp = _STD::move(*__cp);
+                *__pp = _VSTD::move(*__cp);
                 __pp = __cp;
                 __p = __c;
                 __c = (__p + 1) * 2;
@@ -4415,7 +4415,7 @@
                     --__cp;
                 }
             } while (__comp(__t, *__cp));
-            *__pp = _STD::move(__t);
+            *__pp = _VSTD::move(__t);
         }
     }
 }
@@ -4433,17 +4433,17 @@
         _RandomAccessIterator __ptr = __first + __len;
         if (__comp(*__ptr, *--__last))
         {
-            value_type __t(_STD::move(*__last));
+            value_type __t(_VSTD::move(*__last));
             do
             {
-                *__last = _STD::move(*__ptr);
+                *__last = _VSTD::move(*__ptr);
                 __last = __ptr;
                 if (__len == 0)
                     break;
                 __len = (__len - 1) / 2;
                 __ptr = __first + __len;
             } while (__comp(*__ptr, __t));
-            *__last = _STD::move(__t);
+            *__last = _VSTD::move(__t);
         }
     }
 }
@@ -4468,7 +4468,7 @@
 void
 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    _STD::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    _VSTD::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // pop_heap
@@ -4506,7 +4506,7 @@
 void
 pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    _STD::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    _VSTD::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // make_heap
@@ -4546,7 +4546,7 @@
 void
 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    _STD::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    _VSTD::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // sort_heap
@@ -4580,7 +4580,7 @@
 void
 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    _STD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    _VSTD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // partial_sort
@@ -4624,7 +4624,7 @@
 void
 partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
 {
-    _STD::partial_sort(__first, __middle, __last,
+    _VSTD::partial_sort(__first, __middle, __last,
                        __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
@@ -4675,7 +4675,7 @@
 partial_sort_copy(_InputIterator __first, _InputIterator __last,
                   _RandomAccessIterator __result_first, _RandomAccessIterator __result_last)
 {
-    return _STD::partial_sort_copy(__first, __last, __result_first, __result_last,
+    return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,
                                    __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
@@ -4704,7 +4704,7 @@
         case 3:
             {
             _RandomAccessIterator __m = __first;
-            _STD::__sort3<_Compare>(__first, ++__m, --__last, __comp);
+            _VSTD::__sort3<_Compare>(__first, ++__m, --__last, __comp);
             return;
             }
         }
@@ -4716,7 +4716,7 @@
         // __len > __limit >= 3
         _RandomAccessIterator __m = __first + __len/2;
         _RandomAccessIterator __lm1 = __last;
-        unsigned __n_swaps = _STD::__sort3<_Compare>(__first, __m, --__lm1, __comp);
+        unsigned __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, --__lm1, __comp);
         // *__m is median
         // partition [__first, __m) < *__m and *__m <= [__m, __last)
         // (this inhibits tossing elements equivalent to __m around unnecessarily)
@@ -4886,7 +4886,7 @@
 void
 nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last)
 {
-    _STD::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    _VSTD::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
 // includes
@@ -4927,7 +4927,7 @@
 bool
 includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
 {
-    return _STD::includes(__first1, __last1, __first2, __last2,
+    return _VSTD::includes(__first1, __last1, __first2, __last2,
                           __less<typename iterator_traits<_InputIterator1>::value_type,
                                  typename iterator_traits<_InputIterator2>::value_type>());
 }
@@ -4942,7 +4942,7 @@
     for (; __first1 != __last1; ++__result)
     {
         if (__first2 == __last2)
-            return _STD::copy(__first1, __last1, __result);
+            return _VSTD::copy(__first1, __last1, __result);
         if (__comp(*__first2, *__first1))
         {
             *__result = *__first2;
@@ -4956,7 +4956,7 @@
             ++__first1;
         }
     }
-    return _STD::copy(__first2, __last2, __result);
+    return _VSTD::copy(__first2, __last2, __result);
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
@@ -4981,7 +4981,7 @@
 set_union(_InputIterator1 __first1, _InputIterator1 __last1,
           _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
 {
-    return _STD::set_union(__first1, __last1, __first2, __last2, __result,
+    return _VSTD::set_union(__first1, __last1, __first2, __last2, __result,
                           __less<typename iterator_traits<_InputIterator1>::value_type,
                                  typename iterator_traits<_InputIterator2>::value_type>());
 }
@@ -5033,7 +5033,7 @@
 set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
                  _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
 {
-    return _STD::set_intersection(__first1, __last1, __first2, __last2, __result,
+    return _VSTD::set_intersection(__first1, __last1, __first2, __last2, __result,
                                   __less<typename iterator_traits<_InputIterator1>::value_type,
                                          typename iterator_traits<_InputIterator2>::value_type>());
 }
@@ -5048,7 +5048,7 @@
     while (__first1 != __last1)
     {
         if (__first2 == __last2)
-            return _STD::copy(__first1, __last1, __result);
+            return _VSTD::copy(__first1, __last1, __result);
         if (__comp(*__first1, *__first2))
         {
             *__result = *__first1;
@@ -5087,7 +5087,7 @@
 set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
                _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
 {
-    return _STD::set_difference(__first1, __last1, __first2, __last2, __result,
+    return _VSTD::set_difference(__first1, __last1, __first2, __last2, __result,
                                 __less<typename iterator_traits<_InputIterator1>::value_type,
                                        typename iterator_traits<_InputIterator2>::value_type>());
 }
@@ -5102,7 +5102,7 @@
     while (__first1 != __last1)
     {
         if (__first2 == __last2)
-            return _STD::copy(__first1, __last1, __result);
+            return _VSTD::copy(__first1, __last1, __result);
         if (__comp(*__first1, *__first2))
         {
             *__result = *__first1;
@@ -5121,7 +5121,7 @@
             ++__first2;
         }
     }
-    return _STD::copy(__first2, __last2, __result);
+    return _VSTD::copy(__first2, __last2, __result);
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
@@ -5146,7 +5146,7 @@
 set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
                          _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
 {
-    return _STD::set_symmetric_difference(__first1, __last1, __first2, __last2, __result,
+    return _VSTD::set_symmetric_difference(__first1, __last1, __first2, __last2, __result,
                                           __less<typename iterator_traits<_InputIterator1>::value_type,
                                                  typename iterator_traits<_InputIterator2>::value_type>());
 }
@@ -5190,7 +5190,7 @@
 lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
                         _InputIterator2 __first2, _InputIterator2 __last2)
 {
-    return _STD::lexicographical_compare(__first1, __last1, __first2, __last2,
+    return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2,
                                          __less<typename iterator_traits<_InputIterator1>::value_type,
                                                 typename iterator_traits<_InputIterator2>::value_type>());
 }
@@ -5213,12 +5213,12 @@
             while (!__comp(*__i, *--__j))
                 ;
             swap(*__i, *__j);
-            _STD::reverse(__ip1, __last);
+            _VSTD::reverse(__ip1, __last);
             return true;
         }
         if (__i == __first)
         {
-            _STD::reverse(__first, __last);
+            _VSTD::reverse(__first, __last);
             return false;
         }
     }
@@ -5244,7 +5244,7 @@
 bool
 next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
 {
-    return _STD::next_permutation(__first, __last,
+    return _VSTD::next_permutation(__first, __last,
                                   __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
 }
 
@@ -5266,12 +5266,12 @@
             while (!__comp(*--__j, *__i))
                 ;
             swap(*__i, *__j);
-            _STD::reverse(__ip1, __last);
+            _VSTD::reverse(__ip1, __last);
             return true;
         }
         if (__i == __first)
         {
-            _STD::reverse(__first, __last);
+            _VSTD::reverse(__first, __last);
             return false;
         }
     }
@@ -5297,7 +5297,7 @@
 bool
 prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
 {
-    return _STD::prev_permutation(__first, __last,
+    return _VSTD::prev_permutation(__first, __last,
                                   __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
 }
 
diff --git a/include/array b/include/array
index 888fac2..3ac4c55 100644
--- a/include/array
+++ b/include/array
@@ -136,10 +136,10 @@
 
     // No explicit construct/copy/destroy for aggregate type
     _LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u)
-        {_STD::fill_n(__elems_, _Size, __u);}
+        {_VSTD::fill_n(__elems_, _Size, __u);}
     _LIBCPP_INLINE_VISIBILITY
     void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
-        {_STD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
+        {_VSTD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
 
     // iterators:
     _LIBCPP_INLINE_VISIBILITY
@@ -225,7 +225,7 @@
 bool
 operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
-    return _STD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_);
+    return _VSTD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_);
 }
 
 template <class _Tp, size_t _Size>
@@ -241,7 +241,7 @@
 bool
 operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
-    return _STD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size);
+    return _VSTD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size);
 }
 
 template <class _Tp, size_t _Size>
@@ -326,7 +326,7 @@
 _Tp&&
 get(array<_Tp, _Size>&& __a) _NOEXCEPT
 {
-    return _STD::move(__a[_Ip]);
+    return _VSTD::move(__a[_Ip]);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/bitset b/include/bitset
index aa2410e..de0a201 100644
--- a/include/bitset
+++ b/include/bitset
@@ -195,7 +195,7 @@
 inline _LIBCPP_INLINE_VISIBILITY
 __bitset<_N_words, _Size>::__bitset() _NOEXCEPT
 {
-    _STD::fill_n(__first_, _N_words, __storage_type(0));
+    _VSTD::fill_n(__first_, _N_words, __storage_type(0));
 }
 
 template <size_t _N_words, size_t _Size>
@@ -205,8 +205,8 @@
     __storage_type __t[sizeof(unsigned long long) / sizeof(__storage_type)];
     for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= __bits_per_word)
         __t[__i] = static_cast<__storage_type>(__v);
-    _STD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
-    _STD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
+    _VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
+    _VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
                __storage_type(0));
 }
 
@@ -216,7 +216,7 @@
 __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type)
 {
     __first_[0] = __v;
-    _STD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
+    _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
 }
 
 template <size_t _N_words, size_t _Size>
@@ -277,7 +277,7 @@
 __bitset<_N_words, _Size>::to_ulong(false_type) const
 {
     const_iterator __e = __make_iter(_Size);
-    const_iterator __i = _STD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
+    const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
     if (__i != __e)
 #ifndef _LIBCPP_NO_EXCEPTIONS
         throw overflow_error("bitset to_ulong overflow error");
@@ -300,7 +300,7 @@
 __bitset<_N_words, _Size>::to_ullong(false_type) const
 {
     const_iterator __e = __make_iter(_Size);
-    const_iterator __i = _STD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
+    const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
     if (__i != __e)
 #ifndef _LIBCPP_NO_EXCEPTIONS
         throw overflow_error("bitset to_ullong overflow error");
@@ -674,7 +674,7 @@
                       typename basic_string<_CharT>::size_type __n,
                       _CharT __zero, _CharT __one)
 {
-    size_t __rlen = _STD::min(__n, char_traits<_CharT>::length(__str));
+    size_t __rlen = _VSTD::min(__n, char_traits<_CharT>::length(__str));
     for (size_t __i = 0; __i < __rlen; ++__i)
         if (__str[__i] != __zero && __str[__i] != __one)
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -682,7 +682,7 @@
 #else
             assert(!"bitset string ctor has invalid argument");
 #endif
-    size_t _M = _STD::min(__rlen, _Size);
+    size_t _M = _VSTD::min(__rlen, _Size);
     size_t __i = 0;
     for (; __i < _M; ++__i)
     {
@@ -692,7 +692,7 @@
         else
             (*this)[__i] = true;
     }
-    _STD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
+    _VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
 }
 
 template <size_t _Size>
@@ -708,7 +708,7 @@
 #else
         assert(!"bitset string pos out of range");
 #endif
-    size_t __rlen = _STD::min(__n, __str.size() - __pos);
+    size_t __rlen = _VSTD::min(__n, __str.size() - __pos);
     for (size_t __i = __pos; __i < __pos + __rlen; ++__i)
         if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -716,7 +716,7 @@
 #else
             assert(!"bitset string ctor has invalid argument");
 #endif
-    size_t _M = _STD::min(__rlen, _Size);
+    size_t _M = _VSTD::min(__rlen, _Size);
     size_t __i = 0;
     for (; __i < _M; ++__i)
     {
@@ -726,7 +726,7 @@
         else
             (*this)[__i] = true;
     }
-    _STD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
+    _VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
 }
 
 template <size_t _Size>
@@ -760,9 +760,9 @@
 bitset<_Size>&
 bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT
 {
-    __pos = _STD::min(__pos, _Size);
-    _STD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
-    _STD::fill_n(base::__make_iter(0), __pos, false);
+    __pos = _VSTD::min(__pos, _Size);
+    _VSTD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
+    _VSTD::fill_n(base::__make_iter(0), __pos, false);
     return *this;
 }
 
@@ -770,9 +770,9 @@
 bitset<_Size>&
 bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
 {
-    __pos = _STD::min(__pos, _Size);
-    _STD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
-    _STD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
+    __pos = _VSTD::min(__pos, _Size);
+    _VSTD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
+    _VSTD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
     return *this;
 }
 
@@ -781,7 +781,7 @@
 bitset<_Size>&
 bitset<_Size>::set() _NOEXCEPT
 {
-    _STD::fill_n(base::__make_iter(0), _Size, true);
+    _VSTD::fill_n(base::__make_iter(0), _Size, true);
     return *this;
 }
 
@@ -804,7 +804,7 @@
 bitset<_Size>&
 bitset<_Size>::reset() _NOEXCEPT
 {
-    _STD::fill_n(base::__make_iter(0), _Size, false);
+    _VSTD::fill_n(base::__make_iter(0), _Size, false);
     return *this;
 }
 
@@ -917,7 +917,7 @@
 size_t
 bitset<_Size>::count() const _NOEXCEPT
 {
-    return static_cast<size_t>(_STD::count(base::__make_iter(0), base::__make_iter(_Size), true));
+    return static_cast<size_t>(_VSTD::count(base::__make_iter(0), base::__make_iter(_Size), true));
 }
 
 template <size_t _Size>
@@ -925,7 +925,7 @@
 bool
 bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
 {
-    return _STD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
+    return _VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
 }
 
 template <size_t _Size>
diff --git a/include/chrono b/include/chrono
index e5b9a49..a6cd194 100644
--- a/include/chrono
+++ b/include/chrono
@@ -407,7 +407,7 @@
                 (ratio_divide<_Period2, period>::type::den == 1 &&
                  !treat_as_floating_point<_Rep2>::value)
             >::type* = 0)
-                : __rep_(_STD::chrono::duration_cast<duration>(__d).count()) {}
+                : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
 
     // observer
 
@@ -726,7 +726,7 @@
 time_point<_Clock, _ToDuration>
 time_point_cast(const time_point<_Clock, _Duration>& __t)
 {
-    return time_point<_Clock, _ToDuration>(_STD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
+    return time_point<_Clock, _ToDuration>(_VSTD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
 }
 
 // time_point ==
diff --git a/include/complex b/include/complex
index 273a807..f91b240 100644
--- a/include/complex
+++ b/include/complex
@@ -1173,7 +1173,7 @@
 pow(const complex<_Tp>& __x, const complex<_Up>& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;
-    return _STD::pow(result_type(__x), result_type(__y));
+    return _VSTD::pow(result_type(__x), result_type(__y));
 }
 
 template<class _Tp, class _Up>
@@ -1186,7 +1186,7 @@
 pow(const complex<_Tp>& __x, const _Up& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;
-    return _STD::pow(result_type(__x), result_type(__y));
+    return _VSTD::pow(result_type(__x), result_type(__y));
 }
 
 template<class _Tp, class _Up>
@@ -1199,7 +1199,7 @@
 pow(const _Tp& __x, const complex<_Up>& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;
-    return _STD::pow(result_type(__x), result_type(__y));
+    return _VSTD::pow(result_type(__x), result_type(__y));
 }
 
 // asinh
diff --git a/include/condition_variable b/include/condition_variable
index 124d388..fc3ac3d 100644
--- a/include/condition_variable
+++ b/include/condition_variable
@@ -243,7 +243,7 @@
                                  _Predicate __pred)
 {
     return wait_until(__lock, chrono::steady_clock::now() + __d,
-                      _STD::move(__pred));
+                      _VSTD::move(__pred));
 }
 
 _LIBCPP_VISIBLE
diff --git a/include/cstddef b/include/cstddef
index 53ef272..b851ea0 100644
--- a/include/cstddef
+++ b/include/cstddef
@@ -82,7 +82,7 @@
 
 inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);}
 
-#define nullptr _STD::__get_nullptr_t()
+#define nullptr _VSTD::__get_nullptr_t()
 
 #endif  // _LIBCPP_HAS_NO_NULLPTR
 
diff --git a/include/deque b/include/deque
index 10f78a9..a3da803 100644
--- a/include/deque
+++ b/include/deque
@@ -535,7 +535,7 @@
             __n = __bs;
             __m = __f + __n;
         }
-        _STD::copy(__f, __m, __rb);
+        _VSTD::copy(__f, __m, __rb);
         __f = __m;
         __r += __n;
     }
@@ -562,7 +562,7 @@
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _STD::copy(__fb, __fe, __r);
+        __r = _VSTD::copy(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -589,7 +589,7 @@
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _STD::copy(__fb, __fe, __r);
+        __r = _VSTD::copy(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -610,7 +610,7 @@
     typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
     while (__f != __l)
     {
-        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
+        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _VSTD::prev(__r);
         pointer __rb = *__rp.__m_iter_;
         pointer __re = __rp.__ptr_ + 1;
         difference_type __bs = __re - __rb;
@@ -621,7 +621,7 @@
             __n = __bs;
             __m = __l - __n;
         }
-        _STD::copy_backward(__m, __l, __re);
+        _VSTD::copy_backward(__m, __l, __re);
         __l = __m;
         __r -= __n;
     }
@@ -649,7 +649,7 @@
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _STD::copy_backward(__lb, __le, __r);
+        __r = _VSTD::copy_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -677,7 +677,7 @@
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _STD::copy_backward(__lb, __le, __r);
+        __r = _VSTD::copy_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -708,7 +708,7 @@
             __n = __bs;
             __m = __f + __n;
         }
-        _STD::move(__f, __m, __rb);
+        _VSTD::move(__f, __m, __rb);
         __f = __m;
         __r += __n;
     }
@@ -735,7 +735,7 @@
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _STD::move(__fb, __fe, __r);
+        __r = _VSTD::move(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -762,7 +762,7 @@
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _STD::move(__fb, __fe, __r);
+        __r = _VSTD::move(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -783,7 +783,7 @@
     typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
     while (__f != __l)
     {
-        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
+        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _VSTD::prev(__r);
         pointer __rb = *__rp.__m_iter_;
         pointer __re = __rp.__ptr_ + 1;
         difference_type __bs = __re - __rb;
@@ -794,7 +794,7 @@
             __n = __bs;
             __m = __l - __n;
         }
-        _STD::move_backward(__m, __l, __re);
+        _VSTD::move_backward(__m, __l, __re);
         __l = __m;
         __r -= __n;
     }
@@ -822,7 +822,7 @@
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _STD::move_backward(__lb, __le, __r);
+        __r = _VSTD::move_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -850,7 +850,7 @@
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _STD::move_backward(__lb, __le, __r);
+        __r = _VSTD::move_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -961,7 +961,7 @@
         _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                    is_nothrow_move_assignable<allocator_type>::value)
     {
-        __map_ = _STD::move(__c.__map_);
+        __map_ = _VSTD::move(__c.__map_);
         __start_ = __c.__start_;
         size() = __c.size();
         __move_assign_alloc(__c);
@@ -980,7 +980,7 @@
     void __move_assign_alloc(const __deque_base& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
-            __alloc() = _STD::move(__c.__alloc());
+            __alloc() = _VSTD::move(__c.__alloc());
         }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -998,7 +998,7 @@
     static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
         _NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
 
@@ -1097,9 +1097,9 @@
 template <class _Tp, class _Allocator>
 __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
     _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-    : __map_(_STD::move(__c.__map_)),
-      __start_(_STD::move(__c.__start_)),
-      __size_(_STD::move(__c.__size_))
+    : __map_(_VSTD::move(__c.__map_)),
+      __start_(_VSTD::move(__c.__start_)),
+      __size_(_VSTD::move(__c.__size_))
 {
     __c.__start_ = 0;
     __c.size() = 0;
@@ -1107,9 +1107,9 @@
 
 template <class _Tp, class _Allocator>
 __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_type& __a)
-    : __map_(_STD::move(__c.__map_), __pointer_allocator(__a)),
-      __start_(_STD::move(__c.__start_)),
-      __size_(_STD::move(__c.size()), __a)
+    : __map_(_VSTD::move(__c.__map_), __pointer_allocator(__a)),
+      __start_(_VSTD::move(__c.__start_)),
+      __size_(_VSTD::move(__c.size()), __a)
 {
     if (__a == __c.__alloc())
     {
@@ -1133,8 +1133,8 @@
                    __is_nothrow_swappable<allocator_type>::value)
 {
     __map_.swap(__c.__map_);
-    _STD::swap(__start_, __c.__start_);
-    _STD::swap(size(), __c.size());
+    _VSTD::swap(__start_, __c.__start_);
+    _VSTD::swap(size(), __c.size());
     __swap_alloc(__alloc(), __c.__alloc());
 }
 
@@ -1144,7 +1144,7 @@
 {
     allocator_type& __a = __alloc();
     for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
-        __alloc_traits::destroy(__a, _STD::addressof(*__i));
+        __alloc_traits::destroy(__a, _VSTD::addressof(*__i));
     size() = 0;
     while (__map_.size() > 2)
     {
@@ -1184,8 +1184,8 @@
 
     typedef typename __base::pointer               pointer;
     typedef typename __base::const_pointer         const_pointer;
-    typedef _STD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
 
     // construct/copy/destroy:
     _LIBCPP_INLINE_VISIBILITY
@@ -1483,14 +1483,14 @@
 inline _LIBCPP_INLINE_VISIBILITY
 deque<_Tp, _Allocator>::deque(deque&& __c)
     _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-    : __base(_STD::move(__c))
+    : __base(_VSTD::move(__c))
 {
 }
 
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
-    : __base(_STD::move(__c), __a)
+    : __base(_VSTD::move(__c), __a)
 {
     if (__a != __c.__alloc())
     {
@@ -1562,11 +1562,11 @@
     if (static_cast<size_type>(__l - __f) > __base::size())
     {
         _RAIter __m = __f + __base::size();
-        _STD::copy(__f, __m, __base::begin());
+        _VSTD::copy(__f, __m, __base::begin());
         __append(__m, __l);
     }
     else
-        __erase_to_end(_STD::copy(__f, __l, __base::begin()));
+        __erase_to_end(_VSTD::copy(__f, __l, __base::begin()));
 }
 
 template <class _Tp, class _Allocator>
@@ -1575,12 +1575,12 @@
 {
     if (__n > __base::size())
     {
-        _STD::fill_n(__base::begin(), __base::size(), __v);
+        _VSTD::fill_n(__base::begin(), __base::size(), __v);
         __n -= __base::size();
         __append(__n, __v);
     }
     else
-        __erase_to_end(_STD::fill_n(__base::begin(), __n, __v));
+        __erase_to_end(_VSTD::fill_n(__base::begin(), __n, __v));
 }
 
 template <class _Tp, class _Allocator>
@@ -1726,7 +1726,7 @@
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, _STD::addressof(*__base::end()), __v);
+    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
     ++__base::size();
 }
 
@@ -1740,7 +1740,7 @@
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::move(__v));
+    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
     ++__base::size();
 }
 
@@ -1755,7 +1755,7 @@
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
     ++__base::size();
 }
 
@@ -1770,7 +1770,7 @@
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), __v);
+    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
     --__base::__start_;
     ++__base::size();
 }
@@ -1785,7 +1785,7 @@
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::move(__v));
+    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
     --__base::__start_;
     ++__base::size();
 }
@@ -1801,7 +1801,7 @@
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
     --__base::__start_;
     ++__base::size();
 }
@@ -1823,7 +1823,7 @@
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), __v);
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
             --__base::__start_;
             ++__base::size();
         }
@@ -1831,14 +1831,14 @@
         {
             const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __b = __base::begin();
-            iterator __bm1 = _STD::prev(__b);
+            iterator __bm1 = _VSTD::prev(__b);
             if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
                 __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
-            __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
+            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = __move_and_check(_STD::next(__b), __b + __pos, __b, __vt);
+                __b = __move_and_check(_VSTD::next(__b), __b + __pos, __b, __vt);
             *__b = *__vt;
         }
     }
@@ -1850,17 +1850,17 @@
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _STD::addressof(*__base::end()), __v);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
             ++__base::size();
         }
         else
         {
             const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __e = __base::end();
-            iterator __em1 = _STD::prev(__e);
+            iterator __em1 = _VSTD::prev(__e);
             if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
                 __vt = pointer_traits<const_pointer>::pointer_to(*__e);
-            __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
+            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
                 __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
@@ -1886,20 +1886,20 @@
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::move(__v));
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
             --__base::__start_;
             ++__base::size();
         }
         else
         {
             iterator __b = __base::begin();
-            iterator __bm1 = _STD::prev(__b);
-            __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
+            iterator __bm1 = _VSTD::prev(__b);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = _STD::move(_STD::next(__b), __b + __pos, __b);
-            *__b = _STD::move(__v);
+                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
+            *__b = _VSTD::move(__v);
         }
     }
     else
@@ -1910,18 +1910,18 @@
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::move(__v));
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
             ++__base::size();
         }
         else
         {
             iterator __e = __base::end();
-            iterator __em1 = _STD::prev(__e);
-            __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
+            iterator __em1 = _VSTD::prev(__e);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
-                __e = _STD::move_backward(__e - __de, __em1, __e);
-            *--__e = _STD::move(__v);
+                __e = _VSTD::move_backward(__e - __de, __em1, __e);
+            *--__e = _VSTD::move(__v);
         }
     }
     return __base::begin() + __pos;
@@ -1944,20 +1944,20 @@
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
             --__base::__start_;
             ++__base::size();
         }
         else
         {
             iterator __b = __base::begin();
-            iterator __bm1 = _STD::prev(__b);
-            __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
+            iterator __bm1 = _VSTD::prev(__b);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = _STD::move(_STD::next(__b), __b + __pos, __b);
-            *__b = value_type(_STD::forward<_Args>(__args)...);
+                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
+            *__b = value_type(_VSTD::forward<_Args>(__args)...);
         }
     }
     else
@@ -1968,18 +1968,18 @@
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
             ++__base::size();
         }
         else
         {
             iterator __e = __base::end();
-            iterator __em1 = _STD::prev(__e);
-            __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
+            iterator __em1 = _VSTD::prev(__e);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
-                __e = _STD::move_backward(__e - __de, __em1, __e);
-            *--__e = value_type(_STD::forward<_Args>(__args)...);
+                __e = _VSTD::move_backward(__e - __de, __em1, __e);
+            *--__e = value_type(_VSTD::forward<_Args>(__args)...);
         }
     }
     return __base::begin() + __pos;
@@ -2006,7 +2006,7 @@
         if (__n > __pos)
         {
             for (size_type __m = __n - __pos; __m; --__m, --__base::__start_, ++__base::size())
-                __alloc_traits::construct(__a, _STD::addressof(*--__i), __v);
+                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), __v);
             __n = __pos;
         }
         if (__n > 0)
@@ -2016,7 +2016,7 @@
             __move_construct_backward_and_check(__old_begin, __obn, __i, __vt);
             if (__n < __pos)
                 __old_begin = __move_and_check(__obn, __old_begin + __pos, __old_begin, __vt);
-            _STD::fill_n(__old_begin, __n, *__vt);
+            _VSTD::fill_n(__old_begin, __n, *__vt);
         }
     }
     else
@@ -2032,7 +2032,7 @@
         if (__n > __de)
         {
             for (size_type __m = __n - __de; __m; --__m, ++__i, ++__base::size())
-                __alloc_traits::construct(__a, _STD::addressof(*__i), __v);
+                __alloc_traits::construct(__a, _VSTD::addressof(*__i), __v);
             __n = __de;
         }
         if (__n > 0)
@@ -2042,7 +2042,7 @@
             __move_construct_and_check(__oen, __old_end, __i, __vt);
             if (__n < __de)
                 __old_end = __move_backward_and_check(__old_end - __de, __oen, __old_end, __vt);
-            _STD::fill_n(__old_end - __n, __n, *__vt);
+            _VSTD::fill_n(__old_end - __n, __n, *__vt);
         }
     }
     return __base::begin() + __pos;
@@ -2067,7 +2067,7 @@
 deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
                                typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type*)
 {
-    size_type __n = _STD::distance(__f, __l);
+    size_type __n = _VSTD::distance(__f, __l);
     size_type __pos = __p - __base::begin();
     size_type __to_end = __base::size() - __pos;
     allocator_type& __a = __base::__alloc();
@@ -2082,9 +2082,9 @@
         _BiIter __m = __f;
         if (__n > __pos)
         {
-            __m = __pos < __n / 2 ? _STD::prev(__l, __pos) : _STD::next(__f, __n - __pos);
+            __m = __pos < __n / 2 ? _VSTD::prev(__l, __pos) : _VSTD::next(__f, __n - __pos);
             for (_BiIter __j = __m; __j != __f; --__base::__start_, ++__base::size())
-                __alloc_traits::construct(__a, _STD::addressof(*--__i), *--__j);
+                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), *--__j);
             __n = __pos;
         }
         if (__n > 0)
@@ -2092,13 +2092,13 @@
             iterator __obn = __old_begin + __n;
             for (iterator __j = __obn; __j != __old_begin;)
             {
-                __alloc_traits::construct(__a, _STD::addressof(*--__i), _STD::move(*--__j));
+                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), _VSTD::move(*--__j));
                 --__base::__start_;
                 ++__base::size();
             }
             if (__n < __pos)
-                __old_begin = _STD::move(__obn, __old_begin + __pos, __old_begin);
-            _STD::copy(__m, __l, __old_begin);
+                __old_begin = _VSTD::move(__obn, __old_begin + __pos, __old_begin);
+            _VSTD::copy(__m, __l, __old_begin);
         }
     }
     else
@@ -2114,19 +2114,19 @@
         size_type __de = __base::size() - __pos;
         if (__n > __de)
         {
-            __m = __de < __n / 2 ? _STD::next(__f, __de) : _STD::prev(__l, __n - __de);
+            __m = __de < __n / 2 ? _VSTD::next(__f, __de) : _VSTD::prev(__l, __n - __de);
             for (_BiIter __j = __m; __j != __l; ++__i, ++__j, ++__base::size())
-                __alloc_traits::construct(__a, _STD::addressof(*__i), *__j);
+                __alloc_traits::construct(__a, _VSTD::addressof(*__i), *__j);
             __n = __de;
         }
         if (__n > 0)
         {
             iterator __oen = __old_end - __n;
             for (iterator __j = __oen; __j != __old_end; ++__i, ++__j, ++__base::size())
-                __alloc_traits::construct(__a, _STD::addressof(*__i), _STD::move(*__j));
+                __alloc_traits::construct(__a, _VSTD::addressof(*__i), _VSTD::move(*__j));
             if (__n < __de)
-                __old_end = _STD::move_backward(__old_end - __de, __oen, __old_end);
-            _STD::copy_backward(__f, __m, __old_end);
+                __old_end = _VSTD::move_backward(__old_end - __de, __oen, __old_end);
+            _VSTD::copy_backward(__f, __m, __old_end);
         }
     }
     return __base::begin() + __pos;
@@ -2149,14 +2149,14 @@
 deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
                                  typename enable_if<__is_forward_iterator<_ForIter>::value>::type*)
 {
-    size_type __n = _STD::distance(__f, __l);
+    size_type __n = _VSTD::distance(__f, __l);
     allocator_type& __a = __base::__alloc();
     size_type __back_capacity = __back_spare();
     if (__n > __back_capacity)
         __add_back_capacity(__n - __back_capacity);
     // __n <= __back_capacity
     for (iterator __i = __base::end(); __f != __l; ++__i, ++__f, ++__base::size())
-        __alloc_traits::construct(__a, _STD::addressof(*__i), *__f);
+        __alloc_traits::construct(__a, _VSTD::addressof(*__i), *__f);
 }
 
 template <class _Tp, class _Allocator>
@@ -2169,7 +2169,7 @@
         __add_back_capacity(__n - __back_capacity);
     // __n <= __back_capacity
     for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
-        __alloc_traits::construct(__a, _STD::addressof(*__i));
+        __alloc_traits::construct(__a, _VSTD::addressof(*__i));
 }
 
 template <class _Tp, class _Allocator>
@@ -2182,7 +2182,7 @@
         __add_back_capacity(__n - __back_capacity);
     // __n <= __back_capacity
     for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
-        __alloc_traits::construct(__a, _STD::addressof(*__i), __v);
+        __alloc_traits::construct(__a, _VSTD::addressof(*__i), __v);
 }
 
 // Create front capacity for one block of elements.
@@ -2240,10 +2240,10 @@
         for (typename __base::__map_pointer __i = __base::__map_.begin();
                 __i != __base::__map_.end(); ++__i)
             __buf.push_back(*__i);
-        _STD::swap(__base::__map_.__first_, __buf.__first_);
-        _STD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _STD::swap(__base::__map_.__end_, __buf.__end_);
-        _STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
         __base::__start_ = __base::__map_.size() == 1 ?
                                __base::__block_size / 2 :
                                __base::__start_ + __base::__block_size;
@@ -2260,7 +2260,7 @@
     size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
     // Number of unused blocks at back:
     size_type __back_capacity = __back_spare() / __base::__block_size;
-    __back_capacity = _STD::min(__back_capacity, __nb);  // don't take more than you need
+    __back_capacity = _VSTD::min(__back_capacity, __nb);  // don't take more than you need
     __nb -= __back_capacity;  // number of blocks need to allocate
     // If __nb == 0, then we have sufficient capacity.
     if (__nb == 0)
@@ -2327,10 +2327,10 @@
         for (typename __base::__map_pointer __i = __base::__map_.begin();
                 __i != __base::__map_.end(); ++__i)
             __buf.push_back(*__i);
-        _STD::swap(__base::__map_.__first_, __buf.__first_);
-        _STD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _STD::swap(__base::__map_.__end_, __buf.__end_);
-        _STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
         __base::__start_ += __ds;
     }
 }
@@ -2388,10 +2388,10 @@
         for (typename __base::__map_pointer __i = __base::__map_.end();
                 __i != __base::__map_.begin();)
             __buf.push_front(*--__i);
-        _STD::swap(__base::__map_.__first_, __buf.__first_);
-        _STD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _STD::swap(__base::__map_.__end_, __buf.__end_);
-        _STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
     }
 }
 
@@ -2405,7 +2405,7 @@
     size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
     // Number of unused blocks at front:
     size_type __front_capacity = __front_spare() / __base::__block_size;
-    __front_capacity = _STD::min(__front_capacity, __nb);  // don't take more than you need
+    __front_capacity = _VSTD::min(__front_capacity, __nb);  // don't take more than you need
     __nb -= __front_capacity;  // number of blocks need to allocate
     // If __nb == 0, then we have sufficient capacity.
     if (__nb == 0)
@@ -2474,10 +2474,10 @@
         for (typename __base::__map_pointer __i = __base::__map_.end();
                 __i != __base::__map_.begin();)
             __buf.push_front(*--__i);
-        _STD::swap(__base::__map_.__first_, __buf.__first_);
-        _STD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _STD::swap(__base::__map_.__end_, __buf.__end_);
-        _STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
         __base::__start_ -= __ds;
     }
 }
@@ -2525,7 +2525,7 @@
 {
     // as if
     //   for (; __f != __l; ++__f, ++__r)
-    //       *__r = _STD::move(*__f);
+    //       *__r = _VSTD::move(*__f);
     difference_type __n = __l - __f;
     while (__n > 0)
     {
@@ -2539,7 +2539,7 @@
         }
         if (__fb <= __vt && __vt < __fe)
             __vt = (const_iterator(__f.__m_iter_, __vt) -= __f - __r).__ptr_;
-        __r = _STD::move(__fb, __fe, __r);
+        __r = _VSTD::move(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -2555,7 +2555,7 @@
 {
     // as if
     //   while (__f != __l)
-    //       *--__r = _STD::move(*--__l);
+    //       *--__r = _VSTD::move(*--__l);
     difference_type __n = __l - __f;
     while (__n > 0)
     {
@@ -2570,7 +2570,7 @@
         }
         if (__lb <= __vt && __vt < __le)
             __vt = (const_iterator(__l.__m_iter_, __vt) += __r - __l - 1).__ptr_;
-        __r = _STD::move_backward(__lb, __le, __r);
+        __r = _VSTD::move_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -2587,7 +2587,7 @@
     allocator_type& __a = __base::__alloc();
     // as if
     //   for (; __f != __l; ++__r, ++__f, ++__base::size())
-    //       __alloc_traits::construct(__a, _STD::addressof(*__r), _STD::move(*__f));
+    //       __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__f));
     difference_type __n = __l - __f;
     while (__n > 0)
     {
@@ -2602,7 +2602,7 @@
         if (__fb <= __vt && __vt < __fe)
             __vt = (const_iterator(__f.__m_iter_, __vt) += __r - __f).__ptr_;
         for (; __fb != __fe; ++__fb, ++__r, ++__base::size())
-            __alloc_traits::construct(__a, _STD::addressof(*__r), _STD::move(*__fb));
+            __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__fb));
         __n -= __bs;
         __f += __bs;
     }
@@ -2619,7 +2619,7 @@
     // as if
     //   for (iterator __j = __l; __j != __f;)
     //   {
-    //       __alloc_traitsconstruct(__a, _STD::addressof(*--__r), _STD::move(*--__j));
+    //       __alloc_traitsconstruct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__j));
     //       --__base::__start_;
     //       ++__base::size();
     //   }
@@ -2639,7 +2639,7 @@
             __vt = (const_iterator(__l.__m_iter_, __vt) -= __l - __r + 1).__ptr_;
         while (__le != __lb)
         {
-            __alloc_traits::construct(__a, _STD::addressof(*--__r), _STD::move(*--__le));
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__le));
             --__base::__start_;
             ++__base::size();
         }
@@ -2659,8 +2659,8 @@
     allocator_type& __a = __base::__alloc();
     if (__pos < (__base::size() - 1) / 2)
     {   // erase from front
-        _STD::move_backward(__b, __p, _STD::next(__p));
-        __alloc_traits::destroy(__a, _STD::addressof(*__b));
+        _VSTD::move_backward(__b, __p, _VSTD::next(__p));
+        __alloc_traits::destroy(__a, _VSTD::addressof(*__b));
         --__base::size();
         ++__base::__start_;
         if (__front_spare() >= 2 * __base::__block_size)
@@ -2672,8 +2672,8 @@
     }
     else
     {   // erase from back
-        iterator __i = _STD::move(_STD::next(__p), __base::end(), __p);
-        __alloc_traits::destroy(__a, _STD::addressof(*__i));
+        iterator __i = _VSTD::move(_VSTD::next(__p), __base::end(), __p);
+        __alloc_traits::destroy(__a, _VSTD::addressof(*__i));
         --__base::size();
         if (__back_spare() >= 2 * __base::__block_size)
         {
@@ -2697,9 +2697,9 @@
         allocator_type& __a = __base::__alloc();
         if (__pos < (__base::size() - __n) / 2)
         {   // erase from front
-            iterator __i = _STD::move_backward(__b, __p, __p + __n);
+            iterator __i = _VSTD::move_backward(__b, __p, __p + __n);
             for (; __b != __i; ++__b)
-                __alloc_traits::destroy(__a, _STD::addressof(*__b));
+                __alloc_traits::destroy(__a, _VSTD::addressof(*__b));
             __base::size() -= __n;
             __base::__start_ += __n;
             while (__front_spare() >= 2 * __base::__block_size)
@@ -2711,9 +2711,9 @@
         }
         else
         {   // erase from back
-            iterator __i = _STD::move(__p + __n, __base::end(), __p);
+            iterator __i = _VSTD::move(__p + __n, __base::end(), __p);
             for (iterator __e = __base::end(); __i != __e; ++__i)
-                __alloc_traits::destroy(__a, _STD::addressof(*__i));
+                __alloc_traits::destroy(__a, _VSTD::addressof(*__i));
             __base::size() -= __n;
             while (__back_spare() >= 2 * __base::__block_size)
             {
@@ -2737,7 +2737,7 @@
         iterator __b = __base::begin();
         difference_type __pos = __f - __b;
         for (iterator __p = __b + __pos; __p != __e; ++__p)
-            __alloc_traits::destroy(__a, _STD::addressof(*__p));
+            __alloc_traits::destroy(__a, _VSTD::addressof(*__p));
         __base::size() -= __n;
         while (__back_spare() >= 2 * __base::__block_size)
         {
@@ -2771,7 +2771,7 @@
 operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
     const typename deque<_Tp, _Allocator>::size_type __sz = __x.size();
-    return __sz == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
+    return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Tp, class _Allocator>
@@ -2787,7 +2787,7 @@
 bool
 operator< (const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Tp, class _Allocator>
diff --git a/include/exception b/include/exception
index 00fc6b8..f418575 100644
--- a/include/exception
+++ b/include/exception
@@ -199,7 +199,7 @@
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
-    throw __nested<typename remove_reference<_Tp>::type>(_STD::forward<_Tp>(__t));
+    throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
 #endif
 }
 
@@ -218,7 +218,7 @@
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
-    throw _STD::forward<_Tp>(__t);
+    throw _VSTD::forward<_Tp>(__t);
 #endif
 }
 
diff --git a/include/ext/hash_map b/include/ext/hash_map
index 9a0b9ee..49c8d11 100644
--- a/include/ext/hash_map
+++ b/include/ext/hash_map
@@ -341,9 +341,9 @@
     void operator()(pointer __p)
     {
         if (__second_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -666,11 +666,11 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
-    return _STD::move(__h);
+    return _VSTD::move(__h);
 }
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -963,9 +963,9 @@
     {
         _EqRng __xeq = __x.equal_range(__i->first);
         _EqRng __yeq = __y.equal_range(__i->first);
-        if (_STD::distance(__xeq.first, __xeq.second) !=
-            _STD::distance(__yeq.first, __yeq.second) ||
-                  !_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
+        if (_VSTD::distance(__xeq.first, __xeq.second) !=
+            _VSTD::distance(__yeq.first, __yeq.second) ||
+                  !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
             return false;
         __i = __xeq.second;
     }
diff --git a/include/ext/hash_set b/include/ext/hash_set
index 1f8712b..e205db8 100644
--- a/include/ext/hash_set
+++ b/include/ext/hash_set
@@ -627,9 +627,9 @@
     {
         _EqRng __xeq = __x.equal_range(*__i);
         _EqRng __yeq = __y.equal_range(*__i);
-        if (_STD::distance(__xeq.first, __xeq.second) !=
-            _STD::distance(__yeq.first, __yeq.second) ||
-                  !_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
+        if (_VSTD::distance(__xeq.first, __xeq.second) !=
+            _VSTD::distance(__yeq.first, __yeq.second) ||
+                  !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
             return false;
         __i = __xeq.second;
     }
diff --git a/include/forward_list b/include/forward_list
index a3810f0..6fe9311 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -446,7 +446,7 @@
     _LIBCPP_INLINE_VISIBILITY
     void __move_assign_alloc(__forward_list_base& __x, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
-        {__alloc() = _STD::move(__x.__alloc());}
+        {__alloc() = _VSTD::move(__x.__alloc());}
 
     _LIBCPP_INLINE_VISIBILITY
     static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
@@ -464,7 +464,7 @@
                                                                       true_type)
         _NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
 };
@@ -475,7 +475,7 @@
 inline _LIBCPP_INLINE_VISIBILITY
 __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
-    : __before_begin_(_STD::move(__x.__before_begin_))
+    : __before_begin_(_VSTD::move(__x.__before_begin_))
 {
     __x.__before_begin()->__next_ = nullptr;
 }
@@ -509,7 +509,7 @@
                    __is_nothrow_swappable<__node_allocator>::value)
 {
     __swap_alloc(__alloc(), __x.__alloc());
-    using _STD::swap;
+    using _VSTD::swap;
     swap(__before_begin()->__next_, __x.__before_begin()->__next_);
 }
 
@@ -521,7 +521,7 @@
     for (__node_pointer __p = __before_begin()->__next_; __p != nullptr;)
     {
         __node_pointer __next = __p->__next_;
-        __node_traits::destroy(__a, _STD::addressof(__p->__value_));
+        __node_traits::destroy(__a, _VSTD::addressof(__p->__value_));
         __node_traits::deallocate(__a, __p, 1);
         __p = __next;
     }
@@ -577,7 +577,7 @@
     _LIBCPP_INLINE_VISIBILITY
     forward_list(forward_list&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<base>::value)
-        : base(_STD::move(__x)) {}
+        : base(_VSTD::move(__x)) {}
     forward_list(forward_list&& __x, const allocator_type& __a);
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     forward_list(initializer_list<value_type> __il);
@@ -718,7 +718,7 @@
     template <class _Compare>
         _LIBCPP_INLINE_VISIBILITY
         void merge(forward_list&& __x, _Compare __comp)
-        {merge(__x, _STD::move(__comp));}
+        {merge(__x, _VSTD::move(__comp));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void merge(forward_list& __x) {merge(__x, __less<value_type>());}
@@ -766,7 +766,7 @@
                                                              __p = __p->__next_)
         {
             __h.reset(__node_traits::allocate(__a, 1));
-            __node_traits::construct(__a, _STD::addressof(__h->__value_));
+            __node_traits::construct(__a, _VSTD::addressof(__h->__value_));
             __h->__next_ = nullptr;
             __p->__next_ = __h.release();
         }
@@ -832,7 +832,7 @@
 template <class _Tp, class _Alloc>
 forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
                                         const allocator_type& __a)
-    : base(_STD::move(__x), __a)
+    : base(_VSTD::move(__x), __a)
 {
     if (base::__alloc() != __x.__alloc())
     {
@@ -929,7 +929,7 @@
 forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l)
 {
     iterator __i = before_begin();
-    iterator __j = _STD::next(__i);
+    iterator __j = _VSTD::next(__i);
     iterator __e = end();
     for (; __j != __e && __f != __l; ++__i, ++__j, ++__f)
         *__j = *__f;
@@ -944,7 +944,7 @@
 forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
 {
     iterator __i = before_begin();
-    iterator __j = _STD::next(__i);
+    iterator __j = _VSTD::next(__i);
     iterator __e = end();
     for (; __j != __e && __n > 0; --__n, ++__i, ++__j)
         *__j = __v;
@@ -973,8 +973,8 @@
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-    __node_traits::construct(__a, _STD::addressof(__h->__value_),
-                                  _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__a, _VSTD::addressof(__h->__value_),
+                                  _VSTD::forward<_Args>(__args)...);
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
 }
@@ -988,7 +988,7 @@
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-    __node_traits::construct(__a, _STD::addressof(__h->__value_), _STD::move(__v));
+    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
 }
@@ -1002,7 +1002,7 @@
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-    __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
+    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
 }
@@ -1014,7 +1014,7 @@
     __node_allocator& __a = base::__alloc();
     __node_pointer __p = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __p->__next_;
-    __node_traits::destroy(__a, _STD::addressof(__p->__value_));
+    __node_traits::destroy(__a, _VSTD::addressof(__p->__value_));
     __node_traits::deallocate(__a, __p, 1);
 }
 
@@ -1030,8 +1030,8 @@
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-    __node_traits::construct(__a, _STD::addressof(__h->__value_),
-                                  _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__a, _VSTD::addressof(__h->__value_),
+                                  _VSTD::forward<_Args>(__args)...);
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
@@ -1047,7 +1047,7 @@
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-    __node_traits::construct(__a, _STD::addressof(__h->__value_), _STD::move(__v));
+    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
@@ -1063,7 +1063,7 @@
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-    __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
+    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
@@ -1080,7 +1080,7 @@
         __node_allocator& __a = base::__alloc();
         typedef __allocator_destructor<__node_allocator> _D;
         unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-        __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
+        __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
         __node_pointer __first = __h.release();
         __node_pointer __last = __first;
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1090,7 +1090,7 @@
             for (--__n; __n != 0; --__n, __last = __last->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
+                __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
                 __last->__next_ = __h.release();
             }
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1100,7 +1100,7 @@
             while (__first != nullptr)
             {
                 __node_pointer __next = __first->__next_;
-                __node_traits::destroy(__a, _STD::addressof(__first->__value_));
+                __node_traits::destroy(__a, _VSTD::addressof(__first->__value_));
                 __node_traits::deallocate(__a, __first, 1);
                 __first = __next;
             }
@@ -1130,7 +1130,7 @@
         __node_allocator& __a = base::__alloc();
         typedef __allocator_destructor<__node_allocator> _D;
         unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
-        __node_traits::construct(__a, _STD::addressof(__h->__value_), *__f);
+        __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
         __node_pointer __first = __h.release();
         __node_pointer __last = __first;
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1140,7 +1140,7 @@
             for (++__f; __f != __l; ++__f, __last = __last->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _STD::addressof(__h->__value_), *__f);
+                __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
                 __last->__next_ = __h.release();
             }
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1150,7 +1150,7 @@
             while (__first != nullptr)
             {
                 __node_pointer __next = __first->__next_;
-                __node_traits::destroy(__a, _STD::addressof(__first->__value_));
+                __node_traits::destroy(__a, _VSTD::addressof(__first->__value_));
                 __node_traits::deallocate(__a, __first, 1);
                 __first = __next;
             }
@@ -1172,7 +1172,7 @@
     __node_pointer __n = __p->__next_;
     __p->__next_ = __n->__next_;
     __node_allocator& __a = base::__alloc();
-    __node_traits::destroy(__a, _STD::addressof(__n->__value_));
+    __node_traits::destroy(__a, _VSTD::addressof(__n->__value_));
     __node_traits::deallocate(__a, __n, 1);
     return iterator(__p->__next_);
 }
@@ -1193,7 +1193,7 @@
             do
             {
                 __p = __n->__next_;
-                __node_traits::destroy(__a, _STD::addressof(__n->__value_));
+                __node_traits::destroy(__a, _VSTD::addressof(__n->__value_));
                 __node_traits::deallocate(__a, __n, 1);
                 __n = __p;
             } while (__n != __e);
@@ -1226,7 +1226,7 @@
                                                          __ptr = __ptr->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _STD::addressof(__h->__value_));
+                __node_traits::construct(__a, _VSTD::addressof(__h->__value_));
                 __h->__next_ = nullptr;
                 __ptr->__next_ = __h.release();
             }
@@ -1258,7 +1258,7 @@
                                                          __ptr = __ptr->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
+                __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
                 __h->__next_ = nullptr;
                 __ptr->__next_ = __h.release();
             }
@@ -1293,7 +1293,7 @@
                                         forward_list& __x,
                                         const_iterator __i)
 {
-    const_iterator __lm1 = _STD::next(__i);
+    const_iterator __lm1 = _VSTD::next(__i);
     if (__p != __i && __p != __lm1)
     {
         const_cast<__node_pointer>(__i.__ptr_)->__next_ =
@@ -1370,7 +1370,7 @@
     {
         if (__i.__ptr_->__next_->__value_ == __v)
         {
-            iterator __j = _STD::next(__i, 2);
+            iterator __j = _VSTD::next(__i, 2);
             for (; __j != __e && *__j == __v; ++__j)
                 ;
             erase_after(__i, __j);
@@ -1393,7 +1393,7 @@
     {
         if (__pred(__i.__ptr_->__next_->__value_))
         {
-            iterator __j = _STD::next(__i, 2);
+            iterator __j = _VSTD::next(__i, 2);
             for (; __j != __e && __pred(*__j); ++__j)
                 ;
             erase_after(__i, __j);
@@ -1413,7 +1413,7 @@
 {
     for (iterator __i = begin(), __e = end(); __i != __e;)
     {
-        iterator __j = _STD::next(__i);
+        iterator __j = _VSTD::next(__i);
         for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
             ;
         if (__i.__ptr_->__next_ != __j.__ptr_)
@@ -1488,7 +1488,7 @@
 forward_list<_Tp, _Alloc>::sort(_Compare __comp)
 {
     base::__before_begin()->__next_ = __sort(base::__before_begin()->__next_,
-                                       _STD::distance(begin(), end()), __comp);
+                                       _VSTD::distance(begin(), end()), __comp);
 }
 
 template <class _Tp, class _Alloc>
@@ -1514,7 +1514,7 @@
     }
     difference_type __sz1 = __sz / 2;
     difference_type __sz2 = __sz - __sz1;
-    __node_pointer __t = _STD::next(iterator(__f1), __sz1 - 1).__ptr_;
+    __node_pointer __t = _VSTD::next(iterator(__f1), __sz1 - 1).__ptr_;
     __node_pointer __f2 = __t->__next_;
     __t->__next_ = nullptr;
     return __merge(__sort(__f1, __sz1, __comp),
@@ -1570,7 +1570,7 @@
 bool operator< (const forward_list<_Tp, _Alloc>& __x,
                 const forward_list<_Tp, _Alloc>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(),
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(),
                                          __y.begin(), __y.end());
 }
 
diff --git a/include/fstream b/include/fstream
index ea9aee6..7034aab 100644
--- a/include/fstream
+++ b/include/fstream
@@ -362,9 +362,9 @@
     basic_streambuf<char_type, traits_type>::swap(__rhs);
     if (__extbuf_ != __extbuf_min_ && __rhs.__extbuf_ != __rhs.__extbuf_min_)
     {
-        _STD::swap(__extbuf_, __rhs.__extbuf_);
-        _STD::swap(__extbufnext_, __rhs.__extbufnext_);
-        _STD::swap(__extbufend_, __rhs.__extbufend_);
+        _VSTD::swap(__extbuf_, __rhs.__extbuf_);
+        _VSTD::swap(__extbufnext_, __rhs.__extbufnext_);
+        _VSTD::swap(__extbufend_, __rhs.__extbufend_);
     }
     else
     {
@@ -387,17 +387,17 @@
         __rhs.__extbufnext_ = __rhs.__extbuf_ + __ln;
         __rhs.__extbufend_ = __rhs.__extbuf_ + __le;
     }
-    _STD::swap(__ebs_, __rhs.__ebs_);
-    _STD::swap(__intbuf_, __rhs.__intbuf_);
-    _STD::swap(__ibs_, __rhs.__ibs_);
-    _STD::swap(__file_, __rhs.__file_);
-    _STD::swap(__cv_, __rhs.__cv_);
-    _STD::swap(__st_, __rhs.__st_);
-    _STD::swap(__om_, __rhs.__om_);
-    _STD::swap(__cm_, __rhs.__cm_);
-    _STD::swap(__owns_eb_, __rhs.__owns_eb_);
-    _STD::swap(__owns_ib_, __rhs.__owns_ib_);
-    _STD::swap(__always_noconv_, __rhs.__always_noconv_);
+    _VSTD::swap(__ebs_, __rhs.__ebs_);
+    _VSTD::swap(__intbuf_, __rhs.__intbuf_);
+    _VSTD::swap(__ibs_, __rhs.__ibs_);
+    _VSTD::swap(__file_, __rhs.__file_);
+    _VSTD::swap(__cv_, __rhs.__cv_);
+    _VSTD::swap(__st_, __rhs.__st_);
+    _VSTD::swap(__om_, __rhs.__om_);
+    _VSTD::swap(__cm_, __rhs.__cm_);
+    _VSTD::swap(__owns_eb_, __rhs.__owns_eb_);
+    _VSTD::swap(__owns_ib_, __rhs.__owns_ib_);
+    _VSTD::swap(__always_noconv_, __rhs.__always_noconv_);
     if (this->eback() == (char_type*)__rhs.__extbuf_min_)
     {
         ptrdiff_t __n = this->gptr() - this->eback();
@@ -587,7 +587,7 @@
             memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
             __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
             __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
-            size_t __nmemb = _STD::min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
+            size_t __nmemb = _VSTD::min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
                                  static_cast<size_t>(__extbufend_ - __extbufnext_));
             codecvt_base::result __r;
             state_type __svs = __st_;
@@ -1019,8 +1019,8 @@
 template <class _CharT, class _Traits>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)
-    : basic_istream<char_type, traits_type>(_STD::move(__rhs)),
-      __sb_(_STD::move(__rhs.__sb_))
+    : basic_istream<char_type, traits_type>(_VSTD::move(__rhs)),
+      __sb_(_VSTD::move(__rhs.__sb_))
 {
     this->set_rdbuf(&__sb_);
 }
@@ -1030,8 +1030,8 @@
 basic_ifstream<_CharT, _Traits>&
 basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)
 {
-    basic_istream<char_type, traits_type>::operator=(_STD::move(__rhs));
-    __sb_ = _STD::move(__rhs.__sb_);
+    basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+    __sb_ = _VSTD::move(__rhs.__sb_);
     return *this;
 }
 
@@ -1164,8 +1164,8 @@
 template <class _CharT, class _Traits>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)
-    : basic_ostream<char_type, traits_type>(_STD::move(__rhs)),
-      __sb_(_STD::move(__rhs.__sb_))
+    : basic_ostream<char_type, traits_type>(_VSTD::move(__rhs)),
+      __sb_(_VSTD::move(__rhs.__sb_))
 {
     this->set_rdbuf(&__sb_);
 }
@@ -1175,8 +1175,8 @@
 basic_ofstream<_CharT, _Traits>&
 basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)
 {
-    basic_ostream<char_type, traits_type>::operator=(_STD::move(__rhs));
-    __sb_ = _STD::move(__rhs.__sb_);
+    basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+    __sb_ = _VSTD::move(__rhs.__sb_);
     return *this;
 }
 
@@ -1309,8 +1309,8 @@
 template <class _CharT, class _Traits>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)
-    : basic_iostream<char_type, traits_type>(_STD::move(__rhs)),
-      __sb_(_STD::move(__rhs.__sb_))
+    : basic_iostream<char_type, traits_type>(_VSTD::move(__rhs)),
+      __sb_(_VSTD::move(__rhs.__sb_))
 {
     this->set_rdbuf(&__sb_);
 }
@@ -1320,8 +1320,8 @@
 basic_fstream<_CharT, _Traits>&
 basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)
 {
-    basic_iostream<char_type, traits_type>::operator=(_STD::move(__rhs));
-    __sb_ = _STD::move(__rhs.__sb_);
+    basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+    __sb_ = _VSTD::move(__rhs.__sb_);
     return *this;
 }
 
diff --git a/include/functional b/include/functional
index 5ee9db2..d6f9e86 100644
--- a/include/functional
+++ b/include/functional
@@ -884,7 +884,7 @@
        typename __invoke_return<type, _ArgTypes...>::type
           operator() (_ArgTypes&&... __args)
           {
-              return __invoke(__f_, _STD::forward<_ArgTypes>(__args)...);
+              return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
           }
 };
 
@@ -992,9 +992,9 @@
     __compressed_pair<_F, _Alloc> __f_;
 public:
     _LIBCPP_INLINE_VISIBILITY
-    explicit __func(_F __f) : __f_(_STD::move(__f)) {}
+    explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
     _LIBCPP_INLINE_VISIBILITY
-    explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
+    explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
     virtual __base<_R(_ArgTypes...)>* __clone() const;
     virtual void __clone(__base<_R(_ArgTypes...)>*) const;
     virtual void destroy() _NOEXCEPT;
@@ -1046,7 +1046,7 @@
 _R
 __func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
 {
-    return __invoke(__f_.first(), _STD::forward<_ArgTypes>(__arg)...);
+    return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
 }
 
 #ifndef _LIBCPP_NO_RTTI
@@ -1162,7 +1162,7 @@
     template<class _F, class _Alloc>
       _LIBCPP_INLINE_VISIBILITY
       void assign(_F&& __f, const _Alloc& __a)
-        {function(allocator_arg, __a, _STD::forward<_F>(__f)).swap(*this);}
+        {function(allocator_arg, __a, _VSTD::forward<_F>(__f)).swap(*this);}
 
     // function capacity:
     _LIBCPP_INLINE_VISIBILITY
@@ -1263,7 +1263,7 @@
         if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value)
         {
             __f_ = (__base*)&__buf_;
-            ::new (__f_) _FF(_STD::move(__f));
+            ::new (__f_) _FF(_VSTD::move(__f));
         }
         else
         {
@@ -1271,7 +1271,7 @@
             _A __a;
             typedef __allocator_destructor<_A> _D;
             unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
-            ::new (__hold.get()) _FF(_STD::move(__f), allocator<_F>(__a));
+            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_F>(__a));
             __f_ = __hold.release();
         }
     }
@@ -1290,7 +1290,7 @@
         if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value)
         {
             __f_ = (__base*)&__buf_;
-            ::new (__f_) _FF(_STD::move(__f));
+            ::new (__f_) _FF(_VSTD::move(__f));
         }
         else
         {
@@ -1304,7 +1304,7 @@
             _A __a(__a0);
             typedef __allocator_destructor<_A> _D;
             unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
-            ::new (__hold.get()) _FF(_STD::move(__f), _Alloc(__a));
+            ::new (__hold.get()) _FF(_VSTD::move(__f), _Alloc(__a));
             __f_ = __hold.release();
         }
     }
@@ -1361,7 +1361,7 @@
 >::type
 function<_R(_ArgTypes...)>::operator=(_F&& __f)
 {
-    function(_STD::forward<_F>(__f)).swap(*this);
+    function(_VSTD::forward<_F>(__f)).swap(*this);
     return *this;
 }
 
@@ -1408,7 +1408,7 @@
         __f_ = (__base*)&__buf_;
     }
     else
-        _STD::swap(__f_, __f.__f_);
+        _VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _R, class ..._ArgTypes>
@@ -1419,7 +1419,7 @@
     if (__f_ == 0)
         throw bad_function_call();
 #endif  // _LIBCPP_NO_EXCEPTIONS
-    return (*__f_)(_STD::forward<_ArgTypes>(__arg)...);
+    return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
 }
 
 #ifndef _LIBCPP_NO_RTTI
@@ -1524,7 +1524,7 @@
 typename __invoke_of<_Ti&, _Uj...>::type
 __mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
 {
-    return __ti(_STD::forward<_Uj>(get<_Indx>(__uj))...);
+    return __ti(_VSTD::forward<_Uj>(get<_Indx>(__uj))...);
 }
 
 template <class _Ti, class ..._Uj>
@@ -1559,7 +1559,7 @@
 __mu(_Ti&, _Uj& __uj)
 {
     const size_t _Indx = is_placeholder<_Ti>::value - 1;
-    return _STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
+    return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
 }
 
 template <class _Ti, class _Uj>
@@ -1668,14 +1668,14 @@
 public:
     _LIBCPP_INLINE_VISIBILITY
     __bind(__bind&& __b)
-        : __f_(_STD::move(__b.__f_)),
-          __bound_args_(_STD::move(__b.__bound_args_)) {}
+        : __f_(_VSTD::move(__b.__f_)),
+          __bound_args_(_VSTD::move(__b.__bound_args_)) {}
 
     template <class _G, class ..._BA>
       _LIBCPP_INLINE_VISIBILITY
       explicit __bind(_G&& __f, _BA&& ...__bound_args)
-        : __f_(_STD::forward<_G>(__f)),
-          __bound_args_(_STD::forward<_BA>(__bound_args)...) {}
+        : __f_(_VSTD::forward<_G>(__f)),
+          __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
 
     template <class ..._Args>
         _LIBCPP_INLINE_VISIBILITY
@@ -1683,7 +1683,7 @@
         operator()(_Args&& ...__args)
         {
             return __apply_functor(__f_, __bound_args_, __indices(),
-                                  tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
+                                  tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
         }
 
     template <class ..._Args>
@@ -1692,7 +1692,7 @@
         operator()(_Args&& ...__args) const
         {
             return __apply_functor(__f_, __bound_args_, __indices(),
-                                   tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
+                                   tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
         }
 };
 
@@ -1709,20 +1709,20 @@
 
     _LIBCPP_INLINE_VISIBILITY
     __bind_r(__bind_r&& __b)
-        : base(_STD::forward<base>(__b)) {}
+        : base(_VSTD::forward<base>(__b)) {}
 
     template <class _G, class ..._BA>
       _LIBCPP_INLINE_VISIBILITY
       explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
-        : base(_STD::forward<_G>(__f),
-               _STD::forward<_BA>(__bound_args)...) {}
+        : base(_VSTD::forward<_G>(__f),
+               _VSTD::forward<_BA>(__bound_args)...) {}
 
     template <class ..._Args>
         _LIBCPP_INLINE_VISIBILITY
         result_type
         operator()(_Args&& ...__args)
         {
-            return base::operator()(_STD::forward<_Args>(__args)...);
+            return base::operator()(_VSTD::forward<_Args>(__args)...);
         }
 
     template <class ..._Args>
@@ -1730,7 +1730,7 @@
         result_type
         operator()(_Args&& ...__args) const
         {
-            return base::operator()(_STD::forward<_Args>(__args)...);
+            return base::operator()(_VSTD::forward<_Args>(__args)...);
         }
 };
 
@@ -1743,7 +1743,7 @@
 bind(_F&& __f, _BoundArgs&&... __bound_args)
 {
     typedef __bind<_F, _BoundArgs...> type;
-    return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
+    return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
 }
 
 template<class _R, class _F, class ..._BoundArgs>
@@ -1752,7 +1752,7 @@
 bind(_F&& __f, _BoundArgs&&... __bound_args)
 {
     typedef __bind_r<_R, _F, _BoundArgs...> type;
-    return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
+    return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
 }
 
 #endif  // _LIBCPP_HAS_NO_VARIADICS
diff --git a/include/future b/include/future
index e39ae4c..48b84cf 100644
--- a/include/future
+++ b/include/future
@@ -585,7 +585,7 @@
     unique_lock<mutex> __lk(this->__mut_);
     if (this->__has_value())
         throw future_error(make_error_code(future_errc::promise_already_satisfied));
-    ::new(&__value_) _R(_STD::forward<_Arg>(__arg));
+    ::new(&__value_) _R(_VSTD::forward<_Arg>(__arg));
     this->__state_ |= base::__constructed | base::ready;
     __lk.unlock();
     __cv_.notify_all();
@@ -603,7 +603,7 @@
     unique_lock<mutex> __lk(this->__mut_);
     if (this->__has_value())
         throw future_error(make_error_code(future_errc::promise_already_satisfied));
-    ::new(&__value_) _R(_STD::forward<_Arg>(__arg));
+    ::new(&__value_) _R(_VSTD::forward<_Arg>(__arg));
     this->__state_ |= base::__constructed;
     __thread_local_data()->__make_ready_at_thread_exit(this);
     __lk.unlock();
@@ -617,7 +617,7 @@
     this->__sub_wait(__lk);
     if (this->__exception_ != nullptr)
         rethrow_exception(this->__exception_);
-    return _STD::move(*reinterpret_cast<_R*>(&__value_));
+    return _VSTD::move(*reinterpret_cast<_R*>(&__value_));
 }
 
 template <class _R>
@@ -786,7 +786,7 @@
 template <class _R, class _F>
 inline _LIBCPP_INLINE_VISIBILITY
 __deferred_assoc_state<_R, _F>::__deferred_assoc_state(_F&& __f)
-    : __func_(_STD::forward<_F>(__f))
+    : __func_(_VSTD::forward<_F>(__f))
 {
     this->__set_deferred();
 }
@@ -832,7 +832,7 @@
 template <class _F>
 inline _LIBCPP_INLINE_VISIBILITY
 __deferred_assoc_state<void, _F>::__deferred_assoc_state(_F&& __f)
-    : __func_(_STD::forward<_F>(__f))
+    : __func_(_VSTD::forward<_F>(__f))
 {
     this->__set_deferred();
 }
@@ -880,7 +880,7 @@
 template <class _R, class _F>
 inline _LIBCPP_INLINE_VISIBILITY
 __async_assoc_state<_R, _F>::__async_assoc_state(_F&& __f)
-    : __func_(_STD::forward<_F>(__f))
+    : __func_(_VSTD::forward<_F>(__f))
 {
 }
 
@@ -934,7 +934,7 @@
 template <class _F>
 inline _LIBCPP_INLINE_VISIBILITY
 __async_assoc_state<void, _F>::__async_assoc_state(_F&& __f)
-    : __func_(_STD::forward<_F>(__f))
+    : __func_(_VSTD::forward<_F>(__f))
 {
 }
 
@@ -1040,7 +1040,7 @@
     _R get();
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
     _LIBCPP_INLINE_VISIBILITY
@@ -1142,7 +1142,7 @@
     _R& get();
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
     _LIBCPP_INLINE_VISIBILITY
@@ -1239,7 +1239,7 @@
     void get();
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
     _LIBCPP_INLINE_VISIBILITY
@@ -1311,7 +1311,7 @@
 public:
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    void swap(promise& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // retrieving the result
     future<_R> get_future();
@@ -1388,7 +1388,7 @@
 {
     if (__state_ == nullptr)
         throw future_error(make_error_code(future_errc::no_state));
-    __state_->set_value(_STD::move(__r));
+    __state_->set_value(_VSTD::move(__r));
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1419,7 +1419,7 @@
 {
     if (__state_ == nullptr)
         throw future_error(make_error_code(future_errc::no_state));
-    __state_->set_value_at_thread_exit(_STD::move(__r));
+    __state_->set_value_at_thread_exit(_VSTD::move(__r));
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1476,7 +1476,7 @@
 public:
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    void swap(promise& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // retrieving the result
     future<_R&> get_future();
@@ -1609,7 +1609,7 @@
 public:
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    void swap(promise& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // retrieving the result
     future<void> get_future();
@@ -1679,13 +1679,13 @@
     _LIBCPP_INLINE_VISIBILITY
     explicit __packaged_task_func(const _F& __f) : __f_(__f) {}
     _LIBCPP_INLINE_VISIBILITY
-    explicit __packaged_task_func(_F&& __f) : __f_(_STD::move(__f)) {}
+    explicit __packaged_task_func(_F&& __f) : __f_(_VSTD::move(__f)) {}
     _LIBCPP_INLINE_VISIBILITY
     __packaged_task_func(const _F& __f, const _Alloc& __a)
         : __f_(__f, __a) {}
     _LIBCPP_INLINE_VISIBILITY
     __packaged_task_func(_F&& __f, const _Alloc& __a)
-        : __f_(_STD::move(__f), __a) {}
+        : __f_(_VSTD::move(__f), __a) {}
     virtual void __move_to(__packaged_task_base<_R(_ArgTypes...)>*);
     virtual void destroy();
     virtual void destroy_deallocate();
@@ -1697,7 +1697,7 @@
 __packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::__move_to(
                               __packaged_task_base<_R(_ArgTypes...)>* __p)
 {
-    ::new (__p) __packaged_task_func(_STD::move(__f_.first()), _STD::move(__f_.second()));
+    ::new (__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
 }
 
 template<class _F, class _Alloc, class _R, class ..._ArgTypes>
@@ -1721,7 +1721,7 @@
 _R
 __packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
 {
-    return __invoke(__f_.first(), _STD::forward<_ArgTypes>(__arg)...);
+    return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
 }
 
 template <class _Callable> class __packaged_task_function;
@@ -1784,7 +1784,7 @@
     if (sizeof(_FF) <= sizeof(__buf_))
     {
         __f_ = (__base*)&__buf_;
-        ::new (__f_) _FF(_STD::forward<_F>(__f));
+        ::new (__f_) _FF(_VSTD::forward<_F>(__f));
     }
     else
     {
@@ -1792,7 +1792,7 @@
         _A __a;
         typedef __allocator_destructor<_A> _D;
         unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
-        ::new (__hold.get()) _FF(_STD::forward<_F>(__f), allocator<_FR>(__a));
+        ::new (__hold.get()) _FF(_VSTD::forward<_F>(__f), allocator<_FR>(__a));
         __f_ = __hold.release();
     }
 }
@@ -1809,7 +1809,7 @@
     if (sizeof(_FF) <= sizeof(__buf_))
     {
         __f_ = (__base*)&__buf_;
-        ::new (__f_) _FF(_STD::forward<_F>(__f));
+        ::new (__f_) _FF(_VSTD::forward<_F>(__f));
     }
     else
     {
@@ -1823,7 +1823,7 @@
         _A __a(__a0);
         typedef __allocator_destructor<_A> _D;
         unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
-        ::new (__hold.get()) _FF(_STD::forward<_F>(__f), _Alloc(__a));
+        ::new (__hold.get()) _FF(_VSTD::forward<_F>(__f), _Alloc(__a));
         __f_ = __hold.release();
     }
 }
@@ -1894,7 +1894,7 @@
         __f_ = (__base*)&__buf_;
     }
     else
-        _STD::swap(__f_, __f.__f_);
+        _VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _R, class ..._ArgTypes>
@@ -1902,7 +1902,7 @@
 _R
 __packaged_task_function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
 {
-    return (*__f_)(_STD::forward<_ArgTypes>(__arg)...);
+    return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
 }
 
 template<class _R, class ..._ArgTypes>
@@ -1921,11 +1921,11 @@
     packaged_task() : __p_(nullptr) {}
     template <class _F>
         _LIBCPP_INLINE_VISIBILITY
-        explicit packaged_task(_F&& __f) : __f_(_STD::forward<_F>(__f)) {}
+        explicit packaged_task(_F&& __f) : __f_(_VSTD::forward<_F>(__f)) {}
     template <class _F, class _Allocator>
         _LIBCPP_INLINE_VISIBILITY
         explicit packaged_task(allocator_arg_t, const _Allocator& __a, _F&& __f)
-             : __f_(allocator_arg, __a, _STD::forward<_F>(__f)),
+             : __f_(allocator_arg, __a, _VSTD::forward<_F>(__f)),
                __p_(allocator_arg, __a) {}
     // ~packaged_task() = default;
 
@@ -1936,12 +1936,12 @@
     // move support
     _LIBCPP_INLINE_VISIBILITY
     packaged_task(packaged_task&& __other)
-        : __f_(_STD::move(__other.__f_)), __p_(_STD::move(__other.__p_)) {}
+        : __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
     _LIBCPP_INLINE_VISIBILITY
     packaged_task& operator=(packaged_task&& __other)
     {
-        __f_ = _STD::move(__other.__f_);
-        __p_ = _STD::move(__other.__p_);
+        __f_ = _VSTD::move(__other.__f_);
+        __p_ = _VSTD::move(__other.__p_);
         return *this;
     }
     _LIBCPP_INLINE_VISIBILITY
@@ -1977,7 +1977,7 @@
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-        __p_.set_value(__f_(_STD::forward<_ArgTypes>(__args)...));
+        __p_.set_value(__f_(_VSTD::forward<_ArgTypes>(__args)...));
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
     catch (...)
@@ -1999,7 +1999,7 @@
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-        __p_.set_value_at_thread_exit(__f_(_STD::forward<_ArgTypes>(__args)...));
+        __p_.set_value_at_thread_exit(__f_(_VSTD::forward<_ArgTypes>(__args)...));
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
     catch (...)
@@ -2036,11 +2036,11 @@
     packaged_task() : __p_(nullptr) {}
     template <class _F>
         _LIBCPP_INLINE_VISIBILITY
-        explicit packaged_task(_F&& __f) : __f_(_STD::forward<_F>(__f)) {}
+        explicit packaged_task(_F&& __f) : __f_(_VSTD::forward<_F>(__f)) {}
     template <class _F, class _Allocator>
         _LIBCPP_INLINE_VISIBILITY
         explicit packaged_task(allocator_arg_t, const _Allocator& __a, _F&& __f)
-             : __f_(allocator_arg, __a, _STD::forward<_F>(__f)),
+             : __f_(allocator_arg, __a, _VSTD::forward<_F>(__f)),
                __p_(allocator_arg, __a) {}
     // ~packaged_task() = default;
 
@@ -2051,12 +2051,12 @@
     // move support
     _LIBCPP_INLINE_VISIBILITY
     packaged_task(packaged_task&& __other)
-        : __f_(_STD::move(__other.__f_)), __p_(_STD::move(__other.__p_)) {}
+        : __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
     _LIBCPP_INLINE_VISIBILITY
     packaged_task& operator=(packaged_task&& __other)
     {
-        __f_ = _STD::move(__other.__f_);
-        __p_ = _STD::move(__other.__p_);
+        __f_ = _VSTD::move(__other.__f_);
+        __p_ = _VSTD::move(__other.__p_);
         return *this;
     }
     _LIBCPP_INLINE_VISIBILITY
@@ -2092,7 +2092,7 @@
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-        __f_(_STD::forward<_ArgTypes>(__args)...);
+        __f_(_VSTD::forward<_ArgTypes>(__args)...);
         __p_.set_value();
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
@@ -2115,7 +2115,7 @@
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-        __f_(_STD::forward<_ArgTypes>(__args)...);
+        __f_(_VSTD::forward<_ArgTypes>(__args)...);
         __p_.set_value_at_thread_exit();
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
@@ -2158,7 +2158,7 @@
 #endif
 {
     unique_ptr<__deferred_assoc_state<_R, _F>, __release_shared_count>
-        __h(new __deferred_assoc_state<_R, _F>(_STD::forward<_F>(__f)));
+        __h(new __deferred_assoc_state<_R, _F>(_VSTD::forward<_F>(__f)));
     return future<_R>(__h.get());
 }
 
@@ -2171,8 +2171,8 @@
 #endif
 {
     unique_ptr<__async_assoc_state<_R, _F>, __release_shared_count>
-        __h(new __async_assoc_state<_R, _F>(_STD::forward<_F>(__f)));
-    _STD::thread(&__async_assoc_state<_R, _F>::__execute, __h.get()).detach();
+        __h(new __async_assoc_state<_R, _F>(_VSTD::forward<_F>(__f)));
+    _VSTD::thread(&__async_assoc_state<_R, _F>::__execute, __h.get()).detach();
     return future<_R>(__h.get());
 }
 
@@ -2186,10 +2186,10 @@
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __async_func(_F&& __f, _Args&&... __args)
-        : __f_(_STD::move(__f), _STD::move(__args)...) {}
+        : __f_(_VSTD::move(__f), _VSTD::move(__args)...) {}
 
     _LIBCPP_INLINE_VISIBILITY
-    __async_func(__async_func&& __f) : __f_(_STD::move(__f.__f_)) {}
+    __async_func(__async_func&& __f) : __f_(_VSTD::move(__f.__f_)) {}
 
     _R operator()()
     {
@@ -2201,7 +2201,7 @@
     _R
     __execute(__tuple_indices<_Indices...>)
     {
-        return __invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
+        return __invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
     }
 };
 
@@ -2213,11 +2213,11 @@
     typedef typename _BF::_R _R;
     future<_R> __r;
     if (__policy & launch::async)
-        __r = _STD::__make_async_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
-                                                     __decay_copy(_STD::forward<_Args>(__args))...));
+        __r = _VSTD::__make_async_assoc_state<_R>(_BF(__decay_copy(_VSTD::forward<_F>(__f)),
+                                                     __decay_copy(_VSTD::forward<_Args>(__args))...));
     else if (__policy & launch::deferred)
-        __r = _STD::__make_deferred_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
-                                                        __decay_copy(_STD::forward<_Args>(__args))...));
+        __r = _VSTD::__make_deferred_assoc_state<_R>(_BF(__decay_copy(_VSTD::forward<_F>(__f)),
+                                                        __decay_copy(_VSTD::forward<_Args>(__args))...));
     return __r;
 }
 
@@ -2226,8 +2226,8 @@
 future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type>
 async(_F&& __f, _Args&&... __args)
 {
-    return _STD::async(launch::any, _STD::forward<_F>(__f),
-                                    _STD::forward<_Args>(__args)...);
+    return _VSTD::async(launch::any, _VSTD::forward<_F>(__f),
+                                    _VSTD::forward<_Args>(__args)...);
 }
 
 #endif  // _LIBCPP_HAS_NO_VARIADICS
@@ -2269,7 +2269,7 @@
     const _R& get() const {return __state_->copy();}
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(shared_future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
     _LIBCPP_INLINE_VISIBILITY
@@ -2343,7 +2343,7 @@
     _R& get() const {return __state_->copy();}
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(shared_future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
     _LIBCPP_INLINE_VISIBILITY
@@ -2417,7 +2417,7 @@
     void get() const {__state_->copy();}
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(shared_future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
+    void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
     _LIBCPP_INLINE_VISIBILITY
@@ -2450,7 +2450,7 @@
 shared_future<_R>
 future<_R>::share()
 {
-    return shared_future<_R>(_STD::move(*this));
+    return shared_future<_R>(_VSTD::move(*this));
 }
 
 template <class _R>
@@ -2458,7 +2458,7 @@
 shared_future<_R&>
 future<_R&>::share()
 {
-    return shared_future<_R&>(_STD::move(*this));
+    return shared_future<_R&>(_VSTD::move(*this));
 }
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -2467,7 +2467,7 @@
 shared_future<void>
 future<void>::share()
 {
-    return shared_future<void>(_STD::move(*this));
+    return shared_future<void>(_VSTD::move(*this));
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/ios b/include/ios
index b0e7ab9..e2f2b6f 100644
--- a/include/ios
+++ b/include/ios
@@ -266,8 +266,8 @@
     enum seekdir {beg, cur, end};
     typedef seekdir seek_dir;
 
-    typedef _STD::streamoff streamoff;
-    typedef _STD::streampos streampos;
+    typedef _VSTD::streamoff streamoff;
+    typedef _VSTD::streampos streampos;
 
     class Init;
 
@@ -776,8 +776,8 @@
 basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs)
 {
     ios_base::swap(__rhs);
-    _STD::swap(__tie_, __rhs.__tie_);
-    _STD::swap(__fill_, __rhs.__fill_);
+    _VSTD::swap(__tie_, __rhs.__tie_);
+    _VSTD::swap(__fill_, __rhs.__fill_);
 }
 
 template <class _CharT, class _Traits>
diff --git a/include/istream b/include/istream
index b427605..024f5ce 100644
--- a/include/istream
+++ b/include/istream
@@ -321,7 +321,7 @@
 void
 basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)
 {
-    _STD::swap(__gc_, __rhs.__gc_);
+    _VSTD::swap(__gc_, __rhs.__gc_);
     basic_ios<char_type, traits_type>::swap(__rhs);
 }
 
@@ -1273,7 +1273,7 @@
             case 0:
                 break;
             default:
-                __c = _STD::min(__c, __n);
+                __c = _VSTD::min(__c, __n);
                 for (streamsize __k = 0; __k < __c; ++__k, ++__s, ++__i)
                     *__s = *__i;
             }
@@ -1527,7 +1527,7 @@
 template <class _CharT, class _Traits>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
-    : basic_istream<_CharT, _Traits>(_STD::move(__rhs))
+    : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
 {
 }
 
diff --git a/include/iterator b/include/iterator
index 6040eae..b232d09 100644
--- a/include/iterator
+++ b/include/iterator
@@ -488,7 +488,7 @@
      typename iterator_traits<_ForwardIter>::difference_type __n = 1,
      typename enable_if<__is_forward_iterator<_ForwardIter>::value>::type* = 0)
 {
-    _STD::advance(__x, __n);
+    _VSTD::advance(__x, __n);
     return __x;
 }
 
@@ -499,7 +499,7 @@
      typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
      typename enable_if<__is_bidirectional_iterator<_BidiretionalIter>::value>::type* = 0)
 {
-    _STD::advance(__x, -__n);
+    _VSTD::advance(__x, -__n);
     return __x;
 }
 
@@ -628,7 +628,7 @@
         {container->push_back(__value); return *this;}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value)
-        {container->push_back(_STD::move(__value)); return *this;}
+        {container->push_back(_VSTD::move(__value)); return *this;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*()     {return *this;}
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++()    {return *this;}
@@ -661,7 +661,7 @@
         {container->push_front(__value); return *this;}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value)
-        {container->push_front(_STD::move(__value)); return *this;}
+        {container->push_front(_VSTD::move(__value)); return *this;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*()     {return *this;}
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++()    {return *this;}
@@ -696,7 +696,7 @@
         {iter = container->insert(iter, __value); ++iter; return *this;}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value)
-        {iter = container->insert(iter, _STD::move(__value)); ++iter; return *this;}
+        {iter = container->insert(iter, _VSTD::move(__value)); ++iter; return *this;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator*()        {return *this;}
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++()       {return *this;}
diff --git a/include/list b/include/list
index 278f057..79dcb37 100644
--- a/include/list
+++ b/include/list
@@ -423,7 +423,7 @@
     static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
         _NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
     _LIBCPP_INLINE_VISIBILITY
@@ -447,7 +447,7 @@
     void __move_assign_alloc(const __list_imp& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
         {
-            __node_alloc() = _STD::move(__c.__node_alloc());
+            __node_alloc() = _VSTD::move(__c.__node_alloc());
         }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -503,8 +503,8 @@
         {
             __node& __n = *__f.__ptr_;
             ++__f;
-            __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
-            __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
+            __node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
+            __node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
         }
     }
 }
@@ -515,7 +515,7 @@
         _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
                    __is_nothrow_swappable<__node_allocator>::value)
 {
-    using _STD::swap;
+    using _VSTD::swap;
     __swap_alloc(__node_alloc(), __c.__node_alloc());
     swap(__sz(), __c.__sz());
     swap(__end_, __c.__end_);
@@ -555,8 +555,8 @@
     typedef typename base::difference_type           difference_type;
     typedef typename base::iterator                  iterator;
     typedef typename base::const_iterator            const_iterator;
-    typedef _STD::reverse_iterator<iterator>         reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator>   const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>         reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator>   const_reverse_iterator;
 
     _LIBCPP_INLINE_VISIBILITY
     list()
@@ -763,8 +763,8 @@
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::__iterator(size_type __n)
 {
-    return __n <= base::__sz() / 2 ? _STD::next(begin(), __n)
-                                   : _STD::prev(end(), base::__sz() - __n);
+    return __n <= base::__sz() / 2 ? _VSTD::next(begin(), __n)
+                                   : _VSTD::prev(end(), base::__sz() - __n);
 }
 
 template <class _Tp, class _Alloc>
@@ -866,7 +866,7 @@
 inline _LIBCPP_INLINE_VISIBILITY
 list<_Tp, _Alloc>::list(list&& __c)
     _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
-    : base(allocator_type(_STD::move(__c.__node_alloc())))
+    : base(allocator_type(_VSTD::move(__c.__node_alloc())))
 {
     splice(end(), __c);
 }
@@ -969,7 +969,7 @@
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
     __hold->__prev_ = 0;
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
     __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
     ++base::__sz();
     return iterator(__hold.release());
@@ -987,7 +987,7 @@
         typedef __allocator_destructor<__node_allocator> _D;
         unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
         __hold->__prev_ = 0;
-        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
+        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
         ++__ds;
         __r = iterator(__hold.get());
         __hold.release();
@@ -999,7 +999,7 @@
             for (--__n; __n != 0; --__n, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
+                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -1010,7 +1010,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
@@ -1040,7 +1040,7 @@
         typedef __allocator_destructor<__node_allocator> _D;
         unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
         __hold->__prev_ = 0;
-        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), *__f);
+        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
         ++__ds;
         __r = iterator(__hold.get());
         __hold.release();
@@ -1052,7 +1052,7 @@
             for (++__f; __f != __l; ++__f, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), *__f);
+                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -1063,7 +1063,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
@@ -1086,7 +1086,7 @@
     __node_allocator& __na = base::__node_alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
     __link_nodes(*base::__end_.__next_, *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1099,7 +1099,7 @@
     __node_allocator& __na = base::__node_alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
     __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1114,7 +1114,7 @@
     __node_allocator& __na = base::__node_alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::move(__x));
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
     __link_nodes(*base::__end_.__next_, *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1127,7 +1127,7 @@
     __node_allocator& __na = base::__node_alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::move(__x));
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
     __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1143,7 +1143,7 @@
     __node_allocator& __na = base::__node_alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
     __link_nodes(*base::__end_.__next_, *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1157,7 +1157,7 @@
     __node_allocator& __na = base::__node_alloc();
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
     __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1172,7 +1172,7 @@
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
     __hold->__prev_ = 0;
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
     __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
     ++base::__sz();
     return iterator(__hold.release());
@@ -1188,7 +1188,7 @@
     typedef __allocator_destructor<__node_allocator> _D;
     unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
     __hold->__prev_ = 0;
-    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::move(__x));
+    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
     __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
     ++base::__sz();
     return iterator(__hold.release());
@@ -1204,8 +1204,8 @@
     __node& __n = *base::__end_.__next_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-    __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
-    __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
+    __node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
+    __node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
 }
 
 template <class _Tp, class _Alloc>
@@ -1216,8 +1216,8 @@
     __node& __n = *base::__end_.__prev_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-    __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
-    __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
+    __node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
+    __node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
 }
 
 template <class _Tp, class _Alloc>
@@ -1229,8 +1229,8 @@
     __node_pointer __r = __n.__next_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-    __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
-    __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
+    __node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
+    __node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
     return iterator(__r);
 }
 
@@ -1247,8 +1247,8 @@
             __node& __n = const_cast<__node&>(*__f.__ptr_);
             ++__f;
             --base::__sz();
-            __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
-            __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
+            __node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
+            __node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
         }
     }
     return iterator(const_cast<__node_pointer>(__l.__ptr_));
@@ -1268,7 +1268,7 @@
         typedef __allocator_destructor<__node_allocator> _D;
         unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
         __hold->__prev_ = 0;
-        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_));
+        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
         ++__ds;
         iterator __r = iterator(__hold.release());
         iterator __e = __r;
@@ -1279,7 +1279,7 @@
             for (--__n; __n != 0; --__n, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_));
+                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -1290,7 +1290,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
@@ -1319,7 +1319,7 @@
         typedef __allocator_destructor<__node_allocator> _D;
         unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1));
         __hold->__prev_ = 0;
-        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
+        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
         ++__ds;
         iterator __r = iterator(__hold.release());
         iterator __e = __r;
@@ -1330,7 +1330,7 @@
             for (--__n; __n != 0; --__n, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
+                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -1341,7 +1341,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
@@ -1375,7 +1375,7 @@
 void
 list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
 {
-    if (__p != __i && __p != _STD::next(__i))
+    if (__p != __i && __p != _VSTD::next(__i))
     {
         __node& __f = const_cast<__node&>(*__i.__ptr_);
         base::__unlink_nodes(__f, __f);
@@ -1393,7 +1393,7 @@
     {
         if (this != &__c)
         {
-            size_type __s = _STD::distance(__f, __l);
+            size_type __s = _VSTD::distance(__f, __l);
             __c.__sz() -= __s;
             base::__sz() += __s;
         }
@@ -1413,7 +1413,7 @@
     {
         if (*__i == __x)
         {
-            iterator __j = _STD::next(__i);
+            iterator __j = _VSTD::next(__i);
             for (; __j != __e && *__j == __x; ++__j)
                 ;
             __i = erase(__i, __j);
@@ -1432,7 +1432,7 @@
     {
         if (__pred(*__i))
         {
-            iterator __j = _STD::next(__i);
+            iterator __j = _VSTD::next(__i);
             for (; __j != __e && __pred(*__j); ++__j)
                 ;
             __i = erase(__i, __j);
@@ -1457,7 +1457,7 @@
 {
     for (iterator __i = begin(), __e = end(); __i != __e;)
     {
-        iterator __j = _STD::next(__i);
+        iterator __j = _VSTD::next(__i);
         for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
             ;
         if (++__i != __j)
@@ -1489,7 +1489,7 @@
             if (__comp(*__f2, *__f1))
             {
                 size_type __ds = 1;
-                iterator __m2 = _STD::next(__f2);
+                iterator __m2 = _VSTD::next(__f2);
                 for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2, ++__ds)
                     ;
                 base::__sz() += __ds;
@@ -1498,7 +1498,7 @@
                 __node& __l = *__m2.__ptr_->__prev_;
                 __f2 = __m2;
                 base::__unlink_nodes(__f, __l);
-                __m2 = _STD::next(__f1);
+                __m2 = _VSTD::next(__f1);
                 __link_nodes(*__f1.__ptr_, __f, __l);
                 __f1 = __m2;
             }
@@ -1547,12 +1547,12 @@
         return __f1;
     }
     size_type __n2 = __n / 2;
-    iterator __e1 = _STD::next(__f1, __n2);
+    iterator __e1 = _VSTD::next(__f1, __n2);
     iterator  __r = __f1 = __sort(__f1, __e1, __n2, __comp);
     iterator __f2 = __e1 = __sort(__e1, __e2, __n - __n2, __comp);
     if (__comp(*__f2, *__f1))
     {
-        iterator __m2 = _STD::next(__f2);
+        iterator __m2 = _VSTD::next(__f2);
         for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
             ;
         __node& __f = *__f2.__ptr_;
@@ -1560,7 +1560,7 @@
         __r = __f2;
         __e1 = __f2 = __m2;
         base::__unlink_nodes(__f, __l);
-        __m2 = _STD::next(__f1);
+        __m2 = _VSTD::next(__f1);
         __link_nodes(*__f1.__ptr_, __f, __l);
         __f1 = __m2;
     }
@@ -1570,7 +1570,7 @@
     {
         if (__comp(*__f2, *__f1))
         {
-            iterator __m2 = _STD::next(__f2);
+            iterator __m2 = _VSTD::next(__f2);
             for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
                 ;
             __node& __f = *__f2.__ptr_;
@@ -1579,7 +1579,7 @@
                 __e1 = __m2;
             __f2 = __m2;
             base::__unlink_nodes(__f, __l);
-            __m2 = _STD::next(__f1);
+            __m2 = _VSTD::next(__f1);
             __link_nodes(*__f1.__ptr_, __f, __l);
             __f1 = __m2;
         }
@@ -1597,8 +1597,8 @@
     {
         iterator __e = end();
         for (iterator __i = begin(); __i != __e; --__i)
-            _STD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_);
-        _STD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_);
+            _VSTD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_);
+        _VSTD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_);
     }
 }
 
@@ -1607,7 +1607,7 @@
 bool
 operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
-    return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Tp, class _Alloc>
@@ -1615,7 +1615,7 @@
 bool
 operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Tp, class _Alloc>
diff --git a/include/locale b/include/locale
index f9e849b..f85e63c 100644
--- a/include/locale
+++ b/include/locale
@@ -363,7 +363,7 @@
                bool __case_sensitive = true)
 {
     typedef typename iterator_traits<_InputIterator>::value_type _CharT;
-    size_t __nkw = _STD::distance(__kb, __ke);
+    size_t __nkw = _VSTD::distance(__kb, __ke);
     const unsigned char __doesnt_match = '\0';
     const unsigned char __might_match = '\1';
     const unsigned char __does_match = '\2';
@@ -2614,7 +2614,7 @@
     char_type* __nb = __nar;
     char_type* __ne = __nb + 100;
     __do_put(__nb, __ne, __tm, __fmt, __mod);
-    return _STD::copy(__nb, __ne, __s);
+    return _VSTD::copy(__nb, __ne, __s);
 }
 
 extern template class time_put<char>;
@@ -3282,7 +3282,7 @@
             break;
         case money_base::symbol:
             if (!__sym.empty() && (__flags & ios_base::showbase))
-                __me = _STD::copy(__sym.begin(), __sym.end(), __me);
+                __me = _VSTD::copy(__sym.begin(), __sym.end(), __me);
             break;
         case money_base::value:
             {
@@ -3341,7 +3341,7 @@
     }
     // print rest of sign, if any
     if (__sn.size() > 1)
-        __me = _STD::copy(__sn.begin()+1, __sn.end(), __me);
+        __me = _VSTD::copy(__sn.begin()+1, __sn.end(), __me);
     // set alignment
     if ((__flags & ios_base::adjustfield) == ios_base::left)
         __mi = __me;
@@ -3716,8 +3716,8 @@
 inline _LIBCPP_ALWAYS_INLINE
 wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
     wstring_convert(wstring_convert&& __wc)
-        : __byte_err_string_(_STD::move(__wc.__byte_err_string_)),
-          __wide_err_string_(_STD::move(__wc.__wide_err_string_)),
+        : __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
+          __wide_err_string_(_VSTD::move(__wc.__wide_err_string_)),
           __cvtptr_(__wc.__cvtptr_),
           __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtstate_)
 {
@@ -4010,7 +4010,7 @@
             memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
             __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
             __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
-            streamsize __nmemb = _STD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
+            streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
                                  static_cast<streamsize>(__extbufend_ - __extbufnext_));
             codecvt_base::result __r;
             state_type __svs = __st_;
diff --git a/include/map b/include/map
index cf9cbcf..9405617 100644
--- a/include/map
+++ b/include/map
@@ -516,9 +516,9 @@
     void operator()(pointer __p) _NOEXCEPT
     {
         if (__second_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -715,8 +715,8 @@
     typedef typename __alloc_traits::difference_type       difference_type;
     typedef __map_iterator<typename __base::iterator>      iterator;
     typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
-    typedef _STD::reverse_iterator<iterator>               reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator>         const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>               reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit map(const key_compare& __comp = key_compare())
@@ -760,7 +760,7 @@
     _LIBCPP_INLINE_VISIBILITY
     map(map&& __m)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_STD::move(__m.__tree_))
+        : __tree_(_VSTD::move(__m.__tree_))
         {
         }
 
@@ -784,7 +784,7 @@
     map& operator=(map&& __m)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _STD::move(__m.__tree_);
+            __tree_ = _VSTD::move(__m.__tree_);
             return *this;
         }
 
@@ -873,7 +873,7 @@
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool>
         emplace(_A0&& __a0)
-            {return __tree_.__emplace_unique(_STD::forward<_A0>(__a0));}
+            {return __tree_.__emplace_unique(_VSTD::forward<_A0>(__a0));}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -894,7 +894,7 @@
         _LIBCPP_INLINE_VISIBILITY
         iterator
         emplace_hint(const_iterator __p, _A0&& __a0)
-            {return __tree_.__emplace_hint_unique(__p.__i_, _STD::forward<_A0>(__a0));}
+            {return __tree_.__emplace_hint_unique(__p.__i_, _VSTD::forward<_A0>(__a0));}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -909,13 +909,13 @@
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool> insert(_P&& __p)
-            {return __tree_.__insert_unique(_STD::forward<_P>(__p));}
+            {return __tree_.__insert_unique(_VSTD::forward<_P>(__p));}
 
     template <class _P,
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator insert(const_iterator __pos, _P&& __p)
-            {return __tree_.__insert_unique(__pos.__i_, _STD::forward<_P>(__p));}
+            {return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_P>(__p));}
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
@@ -1097,7 +1097,7 @@
     else if (__tree_.value_comp().key_comp()(__hint->first, __k))  // check after
     {
         // *__hint < __k
-        const_iterator __next = _STD::next(__hint);
+        const_iterator __next = _VSTD::next(__hint);
         if (__next == end() || __tree_.value_comp().key_comp()(__k, __next->first))
         {
             // *__hint < __k < *next(__hint)
@@ -1169,14 +1169,14 @@
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
-    : __tree_(_STD::move(__m.__tree_), __a)
+    : __tree_(_VSTD::move(__m.__tree_), __a)
 {
     if (__a != __m.get_allocator())
     {
         const_iterator __e = cend();
         while (!__m.empty())
             __tree_.__insert_unique(__e.__i_,
-                    _STD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
+                    _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
     }
 }
 
@@ -1186,9 +1186,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1201,7 +1201,7 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -1217,9 +1217,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1234,11 +1234,11 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
-    return _STD::move(__h);
+    return _VSTD::move(__h);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1270,7 +1270,7 @@
     __node_pointer __r = static_cast<__node_pointer>(__child);
     if (__child == nullptr)
     {
-        __node_holder __h = __construct_node(_STD::move(__k));
+        __node_holder __h = __construct_node(_VSTD::move(__k));
         __tree_.__insert_node_at(__parent, __child, __h.get());
         __r = __h.release();
     }
@@ -1314,8 +1314,8 @@
 pair<typename map<_Key, _Tp, _Compare, _Allocator>::iterator, bool>
 map<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
-                                         _STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
+                                         _VSTD::forward<_Args>(__args)...);
     pair<iterator, bool> __r = __tree_.__node_insert_unique(__h.get());
     if (__r.second)
         __h.release();
@@ -1330,8 +1330,8 @@
 map<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
                                                    _A0&& __a0, _Args&& ...__args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
-                                         _STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
+                                         _VSTD::forward<_Args>(__args)...);
     iterator __r = __tree_.__node_insert_unique(__p.__i_, __h.get());
     if (__r.__i_.__ptr_ == __h.get())
         __h.release();
@@ -1346,7 +1346,7 @@
 operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
@@ -1355,7 +1355,7 @@
 operator< (const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
@@ -1456,8 +1456,8 @@
     typedef typename __alloc_traits::difference_type       difference_type;
     typedef __map_iterator<typename __base::iterator>      iterator;
     typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
-    typedef _STD::reverse_iterator<iterator>               reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator>         const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>               reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit multimap(const key_compare& __comp = key_compare())
@@ -1502,7 +1502,7 @@
     _LIBCPP_INLINE_VISIBILITY
     multimap(multimap&& __m)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_STD::move(__m.__tree_))
+        : __tree_(_VSTD::move(__m.__tree_))
         {
         }
 
@@ -1526,7 +1526,7 @@
     multimap& operator=(multimap&& __m)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _STD::move(__m.__tree_);
+            __tree_ = _VSTD::move(__m.__tree_);
             return *this;
         }
 
@@ -1605,7 +1605,7 @@
         _LIBCPP_INLINE_VISIBILITY
         iterator
         emplace(_A0&& __a0)
-            {return __tree_.__emplace_multi(_STD::forward<_A0>(__a0));}
+            {return __tree_.__emplace_multi(_VSTD::forward<_A0>(__a0));}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -1625,7 +1625,7 @@
         _LIBCPP_INLINE_VISIBILITY
         iterator
         emplace_hint(const_iterator __p, _A0&& __a0)
-            {return __tree_.__emplace_hint_multi(__p.__i_, _STD::forward<_A0>(__a0));}
+            {return __tree_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_A0>(__a0));}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -1640,13 +1640,13 @@
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator insert(_P&& __p)
-            {return __tree_.__insert_multi(_STD::forward<_P>(__p));}
+            {return __tree_.__insert_multi(_VSTD::forward<_P>(__p));}
 
     template <class _P,
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator insert(const_iterator __pos, _P&& __p)
-            {return __tree_.__insert_multi(__pos.__i_, _STD::forward<_P>(__p));}
+            {return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_P>(__p));}
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
@@ -1735,14 +1735,14 @@
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a)
-    : __tree_(_STD::move(__m.__tree_), __a)
+    : __tree_(_VSTD::move(__m.__tree_), __a)
 {
     if (__a != __m.get_allocator())
     {
         const_iterator __e = cend();
         while (!__m.empty())
             __tree_.__insert_multi(__e.__i_,
-                    _STD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
+                    _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
     }
 }
 
@@ -1752,9 +1752,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1768,7 +1768,7 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -1785,9 +1785,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1804,8 +1804,8 @@
 typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
 multimap<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
-                                         _STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
+                                         _VSTD::forward<_Args>(__args)...);
     iterator __r = __tree_.__node_insert_multi(__h.get());
     __h.release();
     return __r;
@@ -1820,8 +1820,8 @@
                                                         _A0&& __a0,
                                                         _Args&& ...__args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
-                                         _STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
+                                         _VSTD::forward<_Args>(__args)...);
     iterator __r = __tree_.__node_insert_multi(__p.__i_, __h.get());
     __h.release();
     return __r;
@@ -1835,7 +1835,7 @@
 operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
@@ -1844,7 +1844,7 @@
 operator< (const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
diff --git a/include/memory b/include/memory
index 479077f..f2d6d71 100644
--- a/include/memory
+++ b/include/memory
@@ -938,7 +938,7 @@
     _LIBCPP_INLINE_VISIBILITY
     static pointer pointer_to(typename conditional<is_void<element_type>::value,
                                       __nat, element_type>::type& __r) _NOEXCEPT
-        {return _STD::addressof(__r);}
+        {return _VSTD::addressof(__r);}
 };
 
 // allocator_traits
@@ -1072,7 +1072,7 @@
 typename pointer_traits<_Pointer>::element_type*
 __to_raw_pointer(_Pointer __p) _NOEXCEPT
 {
-    return _STD::__to_raw_pointer(__p.operator->());
+    return _VSTD::__to_raw_pointer(__p.operator->());
 }
 
 template <class _Tp>
@@ -1296,8 +1296,8 @@
 #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
 
 template <class _Alloc, class _Tp, class ..._Args>
-decltype(_STD::declval<_Alloc>().construct(_STD::declval<_Tp*>(),
-                                           _STD::declval<_Args>()...),
+decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Tp*>(),
+                                           _VSTD::declval<_Args>()...),
                                            true_type())
 __has_construct_test(_Alloc&& __a, _Tp* __p, _Args&& ...__args);
 
@@ -1467,7 +1467,7 @@
         _LIBCPP_INLINE_VISIBILITY
         static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args)
             {__construct(__has_construct<allocator_type, pointer, _Args...>(),
-                         __a, __p, _STD::forward<_Args>(__args)...);}
+                         __a, __p, _VSTD::forward<_Args>(__args)...);}
 #else  // _LIBCPP_HAS_NO_VARIADICS
     template <class _Tp>
         _LIBCPP_INLINE_VISIBILITY
@@ -1528,12 +1528,12 @@
     template <class _Tp, class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         static void __construct(true_type, allocator_type& __a, _Tp* __p, _Args&&... __args)
-            {__a.construct(__p, _STD::forward<_Args>(__args)...);}
+            {__a.construct(__p, _VSTD::forward<_Args>(__args)...);}
     template <class _Tp, class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         static void __construct(false_type, allocator_type&, _Tp* __p, _Args&&... __args)
             {
-                ::new ((void*)__p) _Tp(_STD::forward<_Args>(__args)...);
+                ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
             }
 #endif  // _LIBCPP_HAS_NO_VARIADICS
 
@@ -1638,9 +1638,9 @@
     _LIBCPP_INLINE_VISIBILITY allocator() _NOEXCEPT {}
     template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) _NOEXCEPT {}
     _LIBCPP_INLINE_VISIBILITY pointer address(reference __x) const _NOEXCEPT
-        {return _STD::addressof(__x);}
+        {return _VSTD::addressof(__x);}
     _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
-        {return _STD::addressof(__x);}
+        {return _VSTD::addressof(__x);}
     _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
         {return static_cast<pointer>(::operator new(__n * sizeof(_Tp)));}
     _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT
@@ -1653,7 +1653,7 @@
         void
         construct(_Up* __p, _Args&&... __args)
         {
-            ::new((void*)__p) _Up(_STD::forward<_Args>(__args)...);
+            ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
         }
 #else  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
         _LIBCPP_INLINE_VISIBILITY
@@ -1694,7 +1694,7 @@
         >::type
         construct(pointer __p, _A0 __a0)
         {
-            ::new((void*)__p) _Tp(_STD::move(__a0));
+            ::new((void*)__p) _Tp(_VSTD::move(__a0));
         }
 # endif  // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
     template <class _A0, class _A1>
@@ -1883,17 +1883,17 @@
 
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1, int = 0)
-        : __first_(_STD::forward<_T1_param>(__t1)) {}
+        : __first_(_VSTD::forward<_T1_param>(__t1)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2, int* = 0)
-        : __second_(_STD::forward<_T2_param>(__t2)) {}
+        : __second_(_VSTD::forward<_T2_param>(__t2)) {}
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
-        : __first_(_STD::forward<_T1_param>(__t1)), __second_(_STD::forward<_T2_param>(__t2)) {}
+        : __first_(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
         _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
                    is_nothrow_move_constructible<_T2>::value)
-        : __first_(_STD::forward<_T1>(__p.first())), __second_(_STD::forward<_T2>(__p.second())) {}
+        : __first_(_VSTD::forward<_T1>(__p.first())), __second_(_VSTD::forward<_T2>(__p.second())) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return __first_;}
@@ -1906,7 +1906,7 @@
         _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                    __is_nothrow_swappable<_T1>::value)
     {
-        using _STD::swap;
+        using _VSTD::swap;
         swap(__first_, __x.__first_);
         swap(__second_, __x.__second_);
     }
@@ -1930,17 +1930,17 @@
 
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1, int = 0)
-        : _T1(_STD::forward<_T1_param>(__t1)) {}
+        : _T1(_VSTD::forward<_T1_param>(__t1)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2, int* = 0)
-        : __second_(_STD::forward<_T2_param>(__t2)) {}
+        : __second_(_VSTD::forward<_T2_param>(__t2)) {}
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
-        : _T1(_STD::forward<_T1_param>(__t1)), __second_(_STD::forward<_T2_param>(__t2)) {}
+        : _T1(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
         _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
                    is_nothrow_move_constructible<_T2>::value)
-        : _T1(_STD::move(__p.first())), __second_(_STD::forward<_T2>(__p.second())) {}
+        : _T1(_VSTD::move(__p.first())), __second_(_VSTD::forward<_T2>(__p.second())) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return *this;}
@@ -1953,7 +1953,7 @@
         _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                    __is_nothrow_swappable<_T1>::value)
     {
-        using _STD::swap;
+        using _VSTD::swap;
         swap(__second_, __x.__second_);
     }
 };
@@ -1976,17 +1976,17 @@
 
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
-        : __first_(_STD::forward<_T1_param>(__t1)) {}
+        : __first_(_VSTD::forward<_T1_param>(__t1)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
-        : _T2(_STD::forward<_T2_param>(__t2)) {}
+        : _T2(_VSTD::forward<_T2_param>(__t2)) {}
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
         _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
                    is_nothrow_move_constructible<_T2>::value)
-        : _T2(_STD::forward<_T2_param>(__t2)), __first_(_STD::forward<_T1_param>(__t1)) {}
+        : _T2(_VSTD::forward<_T2_param>(__t2)), __first_(_VSTD::forward<_T1_param>(__t1)) {}
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
-        : _T2(_STD::forward<_T2>(__p.second())), __first_(_STD::move(__p.first())) {}
+        : _T2(_VSTD::forward<_T2>(__p.second())), __first_(_VSTD::move(__p.first())) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return __first_;}
@@ -1999,7 +1999,7 @@
         _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                    __is_nothrow_swappable<_T1>::value)
     {
-        using _STD::swap;
+        using _VSTD::swap;
         swap(__first_, __x.__first_);
     }
 };
@@ -2021,17 +2021,17 @@
 
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
-        : _T1(_STD::forward<_T1_param>(__t1)) {}
+        : _T1(_VSTD::forward<_T1_param>(__t1)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
-        : _T2(_STD::forward<_T2_param>(__t2)) {}
+        : _T2(_VSTD::forward<_T2_param>(__t2)) {}
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
-        : _T1(_STD::forward<_T1_param>(__t1)), _T2(_STD::forward<_T2_param>(__t2)) {}
+        : _T1(_VSTD::forward<_T1_param>(__t1)), _T2(_VSTD::forward<_T2_param>(__t2)) {}
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
         _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
                    is_nothrow_move_constructible<_T2>::value)
-        : _T1(_STD::move(__p.first())), _T2(_STD::move(__p.second())) {}
+        : _T1(_VSTD::move(__p.first())), _T2(_VSTD::move(__p.second())) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return *this;}
@@ -2064,17 +2064,17 @@
 
     _LIBCPP_INLINE_VISIBILITY __compressed_pair() {}
     _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T1_param __t1, int = 0)
-        : base(_STD::forward<_T1_param>(__t1)) {}
+        : base(_VSTD::forward<_T1_param>(__t1)) {}
     _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T2_param __t2, int* = 0)
-        : base(_STD::forward<_T2_param>(__t2)) {}
+        : base(_VSTD::forward<_T2_param>(__t2)) {}
     _LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
-        : base(_STD::forward<_T1_param>(__t1), _STD::forward<_T2_param>(__t2)) {}
+        : base(_VSTD::forward<_T1_param>(__t1), _VSTD::forward<_T2_param>(__t2)) {}
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     __compressed_pair(__compressed_pair&& __p)
         _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
                    is_nothrow_move_constructible<_T2>::value)
-        : base(_STD::move(__p)) {}
+        : base(_VSTD::move(__p)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return base::first();}
@@ -2167,7 +2167,7 @@
                 "unique_ptr constructed with null function pointer deleter");
         }
     _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p) _NOEXCEPT
-        : __ptr_(_STD::move(__p))
+        : __ptr_(_VSTD::move(__p))
         {
             static_assert(!is_pointer<deleter_type>::value,
                 "unique_ptr constructed with null function pointer deleter");
@@ -2183,12 +2183,12 @@
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename remove_reference<deleter_type>::type&& __d)
              _NOEXCEPT
-        : __ptr_(__p, _STD::move(__d))
+        : __ptr_(__p, _VSTD::move(__d))
         {
             static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
         }
     _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
-        : __ptr_(__u.release(), _STD::forward<deleter_type>(__u.get_deleter())) {}
+        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
     template <class _Up, class _Ep>
         _LIBCPP_INLINE_VISIBILITY
         unique_ptr(unique_ptr<_Up, _Ep>&& __u,
@@ -2203,7 +2203,7 @@
                          ),
                          __nat
                       >::type = __nat()) _NOEXCEPT
-            : __ptr_(__u.release(), _STD::forward<_Ep>(__u.get_deleter())) {}
+            : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
 
     template <class _Up>
         _LIBCPP_INLINE_VISIBILITY unique_ptr(auto_ptr<_Up>&& __p,
@@ -2219,7 +2219,7 @@
         _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
             {
                 reset(__u.release());
-                __ptr_.second() = _STD::forward<deleter_type>(__u.get_deleter());
+                __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
                 return *this;
             }
 
@@ -2233,7 +2233,7 @@
             operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
             {
                 reset(__u.release());
-                __ptr_.second() = _STD::forward<_Ep>(__u.get_deleter());
+                __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
                 return *this;
             }
 #else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -2244,18 +2244,18 @@
     }
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
-        : __ptr_(__u->release(), _STD::forward<deleter_type>(__u->get_deleter())) {}
+        : __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
 
     template <class _Up, class _Ep>
     _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr<_Up, _Ep> __u)
     {
         reset(__u.release());
-        __ptr_.second() = _STD::forward<deleter_type>(__u.get_deleter());
+        __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
         return *this;
     }
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
-        : __ptr_(_STD::move(__p), _STD::move(__d)) {}
+        : __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {}
 
     template <class _Up>
         _LIBCPP_INLINE_VISIBILITY
@@ -2380,25 +2380,25 @@
              >
     _LIBCPP_INLINE_VISIBILITY unique_ptr(_P __p, typename remove_reference<deleter_type>::type&& __d)
              _NOEXCEPT
-        : __ptr_(__p, _STD::move(__d))
+        : __ptr_(__p, _VSTD::move(__d))
         {
             static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
         }
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, typename remove_reference<deleter_type>::type&& __d)
              _NOEXCEPT
-        : __ptr_(pointer(), _STD::move(__d))
+        : __ptr_(pointer(), _VSTD::move(__d))
         {
             static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
         }
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
-        : __ptr_(__u.release(), _STD::forward<deleter_type>(__u.get_deleter())) {}
+        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
         {
             reset(__u.release());
-            __ptr_.second() = _STD::forward<deleter_type>(__u.get_deleter());
+            __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
             return *this;
         }
 #else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -2411,10 +2411,10 @@
         }
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
-        : __ptr_(__p, _STD::forward<deleter_type>(__d)) {}
+        : __ptr_(__p, _VSTD::forward<deleter_type>(__d)) {}
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, deleter_type __d)
-        : __ptr_(pointer(), _STD::forward<deleter_type>(__d)) {}
+        : __ptr_(pointer(), _VSTD::forward<deleter_type>(__d)) {}
 
     _LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
     {
@@ -2422,12 +2422,12 @@
     }
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
-        : __ptr_(__u->release(), _STD::forward<deleter_type>(__u->get_deleter())) {}
+        : __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
 
     _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(__rv<unique_ptr> __u)
     {
         reset(__u->release());
-        __ptr_.second() = _STD::forward<deleter_type>(__u->get_deleter());
+        __ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter());
         return *this;
     }
 
@@ -2752,7 +2752,7 @@
 public:
     _LIBCPP_INLINE_VISIBILITY
     __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
-        :  __data_(__compressed_pair<_Tp, _Dp>(__p, _STD::move(__d)), _STD::move(__a)) {}
+        :  __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
 
 #ifndef _LIBCPP_NO_RTTI
     virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
@@ -2801,12 +2801,12 @@
 
     _LIBCPP_INLINE_VISIBILITY
     __shared_ptr_emplace(_Alloc __a)
-        :  __data_(_STD::move(__a)) {}
+        :  __data_(_VSTD::move(__a)) {}
 
     template <class ..._Args>
         _LIBCPP_INLINE_VISIBILITY
         __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
-            :  __data_(_STD::move(__a), _Tp(_STD::forward<_Args>(__args)...)) {}
+            :  __data_(_VSTD::move(__a), _Tp(_VSTD::forward<_Args>(__args)...)) {}
 
 #else  // _LIBCPP_HAS_NO_VARIADICS
 
@@ -3271,7 +3271,7 @@
     typedef __allocator_destructor<_A2> _D2;
     _A2 __a2;
     unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
-    ::new(__hold2.get()) _CntrlBlk(__a2, _STD::forward<_Args>(__args)...);
+    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
     shared_ptr<_Tp> __r;
     __r.__ptr_ = __hold2.get()->get();
     __r.__cntrl_ = __hold2.release();
@@ -3289,7 +3289,7 @@
     typedef __allocator_destructor<_A2> _D2;
     _A2 __a2(__a);
     unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
-    ::new(__hold2.get()) _CntrlBlk(__a, _STD::forward<_Args>(__args)...);
+    ::new(__hold2.get()) _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
     shared_ptr<_Tp> __r;
     __r.__ptr_ = __hold2.get()->get();
     __r.__cntrl_ = __hold2.release();
@@ -3477,7 +3477,7 @@
 shared_ptr<_Tp>&
 shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
 {
-    shared_ptr(_STD::move(__r)).swap(*this);
+    shared_ptr(_VSTD::move(__r)).swap(*this);
     return *this;
 }
 
@@ -3487,7 +3487,7 @@
 shared_ptr<_Tp>&
 shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
 {
-    shared_ptr(_STD::move(__r)).swap(*this);
+    shared_ptr(_VSTD::move(__r)).swap(*this);
     return *this;
 }
 
@@ -3497,7 +3497,7 @@
 shared_ptr<_Tp>&
 shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
 {
-    shared_ptr(_STD::move(__r)).swap(*this);
+    shared_ptr(_VSTD::move(__r)).swap(*this);
     return *this;
 }
 
@@ -3507,7 +3507,7 @@
 shared_ptr<_Tp>&
 shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
 {
-    shared_ptr(_STD::move(__r)).swap(*this);
+    shared_ptr(_VSTD::move(__r)).swap(*this);
     return *this;
 }
 
@@ -3529,7 +3529,7 @@
 shared_ptr<_Tp>&
 shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
 {
-    shared_ptr(_STD::move(__r)).swap(*this);
+    shared_ptr(_VSTD::move(__r)).swap(*this);
     return *this;
 }
 
@@ -3540,8 +3540,8 @@
 void
 shared_ptr<_Tp>::swap(shared_ptr& __r) _NOEXCEPT
 {
-    _STD::swap(__ptr_, __r.__ptr_);
-    _STD::swap(__cntrl_, __r.__cntrl_);
+    _VSTD::swap(__ptr_, __r.__ptr_);
+    _VSTD::swap(__cntrl_, __r.__cntrl_);
 }
 
 template<class _Tp>
@@ -3586,7 +3586,7 @@
 shared_ptr<_Tp>
 make_shared(_Args&& ...__args)
 {
-    return shared_ptr<_Tp>::make_shared(_STD::forward<_Args>(__args)...);
+    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
 }
 
 template<class _Tp, class _Alloc, class ..._Args>
@@ -3594,7 +3594,7 @@
 shared_ptr<_Tp>
 allocate_shared(const _Alloc& __a, _Args&& ...__args)
 {
-    return shared_ptr<_Tp>::allocate_shared(__a, _STD::forward<_Args>(__args)...);
+    return shared_ptr<_Tp>::allocate_shared(__a, _VSTD::forward<_Args>(__args)...);
 }
 
 #else  // _LIBCPP_HAS_NO_VARIADICS
@@ -3866,8 +3866,8 @@
 void
 weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT
 {
-    _STD::swap(__ptr_, __r.__ptr_);
-    _STD::swap(__cntrl_, __r.__cntrl_);
+    _VSTD::swap(__ptr_, __r.__ptr_);
+    _VSTD::swap(__cntrl_, __r.__cntrl_);
 }
 
 template<class _Tp>
diff --git a/include/mutex b/include/mutex
index 69192a8..297baca 100644
--- a/include/mutex
+++ b/include/mutex
@@ -467,7 +467,7 @@
 public:
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    explicit __call_once_param(_F&& __f) : __f_(_STD::move(__f)) {}
+    explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
 #else
     _LIBCPP_INLINE_VISIBILITY
     explicit __call_once_param(const _F& __f) : __f_(__f) {}
@@ -485,7 +485,7 @@
     _LIBCPP_INLINE_VISIBILITY
     void __execute(__tuple_indices<_Indices...>)
     {
-        __invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
+        __invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
     }
 };
 
@@ -498,7 +498,7 @@
 public:
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    explicit __call_once_param(_F&& __f) : __f_(_STD::move(__f)) {}
+    explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
 #else
     _LIBCPP_INLINE_VISIBILITY
     explicit __call_once_param(const _F& __f) : __f_(__f) {}
@@ -533,8 +533,8 @@
     if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
     {
         typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G;
-        __call_once_param<_G> __p(_G(__decay_copy(_STD::forward<_Callable>(__func)),
-                                __decay_copy(_STD::forward<_Args>(__args))...));
+        __call_once_param<_G> __p(_G(__decay_copy(_VSTD::forward<_Callable>(__func)),
+                                __decay_copy(_VSTD::forward<_Args>(__args))...));
         __call_once(__flag.__state_, &__p, &__call_once_proxy<_G>);
     }
 }
diff --git a/include/queue b/include/queue
index 896c682..bed5bb7 100644
--- a/include/queue
+++ b/include/queue
@@ -211,7 +211,7 @@
     _LIBCPP_INLINE_VISIBILITY
     queue(queue&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
-        : c(_STD::move(__q.c)) {}
+        : c(_VSTD::move(__q.c)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
@@ -221,14 +221,14 @@
     _LIBCPP_INLINE_VISIBILITY
     queue& operator=(queue&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
-        {c = _STD::move(__q.c); return *this;}
+        {c = _VSTD::move(__q.c); return *this;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     explicit queue(const container_type& __c)  : c(__c) {}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    explicit queue(container_type&& __c) : c(_STD::move(__c)) {}
+    explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
@@ -254,13 +254,13 @@
         queue(container_type&& __c, const _Alloc& __a,
                        typename enable_if<uses_allocator<container_type,
                                                          _Alloc>::value>::type* = 0)
-            : c(_STD::move(__c), __a) {}
+            : c(_VSTD::move(__c), __a) {}
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         queue(queue&& __q, const _Alloc& __a,
                        typename enable_if<uses_allocator<container_type,
                                                          _Alloc>::value>::type* = 0)
-            : c(_STD::move(__q.c), __a) {}
+            : c(_VSTD::move(__q.c), __a) {}
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
@@ -282,12 +282,12 @@
     void push(const value_type& __v) {c.push_back(__v);}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    void push(value_type&& __v)      {c.push_back(_STD::move(__v));}
+    void push(value_type&& __v)      {c.push_back(_VSTD::move(__v));}
 #ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         void emplace(_Args&&... __args)
-            {c.emplace_back(_STD::forward<_Args>(__args)...);}
+            {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
 #endif  // _LIBCPP_HAS_NO_VARIADICS
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
@@ -297,7 +297,7 @@
     void swap(queue& __q)
         _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
     {
-        using _STD::swap;
+        using _VSTD::swap;
         swap(c, __q.c);
     }
 
@@ -408,7 +408,7 @@
     priority_queue(priority_queue&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
                    is_nothrow_move_constructible<value_compare>::value)
-        : c(_STD::move(__q.c)), comp(_STD::move(__q.comp)) {}
+        : c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
@@ -420,7 +420,7 @@
     priority_queue& operator=(priority_queue&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
                    is_nothrow_move_assignable<value_compare>::value)
-        {c = _STD::move(__q.c); comp = _STD::move(__q.comp); return *this;}
+        {c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
@@ -498,7 +498,7 @@
     : c(__c),
       comp(__comp)
 {
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -507,10 +507,10 @@
 inline _LIBCPP_INLINE_VISIBILITY
 priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
                                                           container_type&& __c)
-    : c(_STD::move(__c)),
+    : c(_VSTD::move(__c)),
       comp(__comp)
 {
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -523,7 +523,7 @@
     : c(__f, __l),
       comp(__comp)
 {
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -536,7 +536,7 @@
       comp(__comp)
 {
     c.insert(c.end(), __f, __l);
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -547,11 +547,11 @@
 priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
                                                           const value_compare& __comp,
                                                           container_type&& __c)
-    : c(_STD::move(__c)),
+    : c(_VSTD::move(__c)),
       comp(__comp)
 {
     c.insert(c.end(), __f, __l);
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -589,7 +589,7 @@
     : c(__c, __a),
       comp(__comp)
 {
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -602,7 +602,7 @@
     : c(__q.c, __a),
       comp(__q.comp)
 {
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -615,10 +615,10 @@
                                                           const _Alloc& __a,
                        typename enable_if<uses_allocator<container_type,
                                                          _Alloc>::value>::type*)
-    : c(_STD::move(__c), __a),
+    : c(_VSTD::move(__c), __a),
       comp(__comp)
 {
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -628,10 +628,10 @@
                                                           const _Alloc& __a,
                        typename enable_if<uses_allocator<container_type,
                                                          _Alloc>::value>::type*)
-    : c(_STD::move(__q.c), __a),
-      comp(_STD::move(__q.comp))
+    : c(_VSTD::move(__q.c), __a),
+      comp(_VSTD::move(__q.comp))
 {
-    _STD::make_heap(c.begin(), c.end(), comp);
+    _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -642,7 +642,7 @@
 priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
 {
     c.push_back(__v);
-    _STD::push_heap(c.begin(), c.end(), comp);
+    _VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -652,8 +652,8 @@
 void
 priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
 {
-    c.push_back(_STD::move(__v));
-    _STD::push_heap(c.begin(), c.end(), comp);
+    c.push_back(_VSTD::move(__v));
+    _VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -664,8 +664,8 @@
 void
 priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
 {
-    c.emplace_back(_STD::forward<_Args>(__args)...);
-    _STD::push_heap(c.begin(), c.end(), comp);
+    c.emplace_back(_VSTD::forward<_Args>(__args)...);
+    _VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
 #endif  // _LIBCPP_HAS_NO_VARIADICS
@@ -676,7 +676,7 @@
 void
 priority_queue<_Tp, _Container, _Compare>::pop()
 {
-    _STD::pop_heap(c.begin(), c.end(), comp);
+    _VSTD::pop_heap(c.begin(), c.end(), comp);
     c.pop_back();
 }
 
@@ -687,7 +687,7 @@
         _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
                    __is_nothrow_swappable<value_compare>::value)
 {
-    using _STD::swap;
+    using _VSTD::swap;
     swap(c, __q.c);
     swap(comp, __q.comp);
 }
diff --git a/include/random b/include/random
index 49646e9..ace47a1 100644
--- a/include/random
+++ b/include/random
@@ -2313,37 +2313,37 @@
                                          _B, _T, _C, _L, _F>& __y)
 {
     if (__x.__i_ == __y.__i_)
-        return _STD::equal(__x.__x_, __x.__x_ + _N, __y.__x_);
+        return _VSTD::equal(__x.__x_, __x.__x_ + _N, __y.__x_);
     if (__x.__i_ == 0 || __y.__i_ == 0)
     {
-        size_t __j = _STD::min(_N - __x.__i_, _N - __y.__i_);
-        if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
+        size_t __j = _VSTD::min(_N - __x.__i_, _N - __y.__i_);
+        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
                          __y.__x_ + __y.__i_))
             return false;
         if (__x.__i_ == 0)
-            return _STD::equal(__x.__x_ + __j, __x.__x_ + _N, __y.__x_);
-        return _STD::equal(__x.__x_, __x.__x_ + (_N - __j), __y.__x_ + __j);
+            return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _N, __y.__x_);
+        return _VSTD::equal(__x.__x_, __x.__x_ + (_N - __j), __y.__x_ + __j);
     }
     if (__x.__i_ < __y.__i_)
     {
         size_t __j = _N - __y.__i_;
-        if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
+        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
                          __y.__x_ + __y.__i_))
             return false;
-        if (!_STD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _N,
+        if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _N,
                          __y.__x_))
             return false;
-        return _STD::equal(__x.__x_, __x.__x_ + __x.__i_,
+        return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
                            __y.__x_ + (_N - (__x.__i_ + __j)));
     }
     size_t __j = _N - __x.__i_;
-    if (!_STD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
+    if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
                      __x.__x_ + __x.__i_))
         return false;
-    if (!_STD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _N,
+    if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _N,
                      __x.__x_))
         return false;
-    return _STD::equal(__y.__x_, __y.__x_ + __y.__i_,
+    return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
                        __x.__x_ + (_N - (__y.__i_ + __j)));
 }
 
@@ -2621,37 +2621,37 @@
     if (__x.__c_ != __y.__c_)
         return false;
     if (__x.__i_ == __y.__i_)
-        return _STD::equal(__x.__x_, __x.__x_ + _R, __y.__x_);
+        return _VSTD::equal(__x.__x_, __x.__x_ + _R, __y.__x_);
     if (__x.__i_ == 0 || __y.__i_ == 0)
     {
-        size_t __j = _STD::min(_R - __x.__i_, _R - __y.__i_);
-        if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
+        size_t __j = _VSTD::min(_R - __x.__i_, _R - __y.__i_);
+        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
                          __y.__x_ + __y.__i_))
             return false;
         if (__x.__i_ == 0)
-            return _STD::equal(__x.__x_ + __j, __x.__x_ + _R, __y.__x_);
-        return _STD::equal(__x.__x_, __x.__x_ + (_R - __j), __y.__x_ + __j);
+            return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _R, __y.__x_);
+        return _VSTD::equal(__x.__x_, __x.__x_ + (_R - __j), __y.__x_ + __j);
     }
     if (__x.__i_ < __y.__i_)
     {
         size_t __j = _R - __y.__i_;
-        if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
+        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
                          __y.__x_ + __y.__i_))
             return false;
-        if (!_STD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _R,
+        if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _R,
                          __y.__x_))
             return false;
-        return _STD::equal(__x.__x_, __x.__x_ + __x.__i_,
+        return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
                            __y.__x_ + (_R - (__x.__i_ + __j)));
     }
     size_t __j = _R - __x.__i_;
-    if (!_STD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
+    if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
                      __x.__x_ + __x.__i_))
         return false;
-    if (!_STD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _R,
+    if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _R,
                      __x.__x_))
         return false;
-    return _STD::equal(__y.__x_, __y.__x_ + __y.__i_,
+    return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
                        __x.__x_ + (_R - (__y.__i_ + __j)));
 }
 
@@ -2744,7 +2744,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit discard_block_engine(_Engine&& __e)
-        : __e_(_STD::move(__e)), __n_(0) {}
+        : __e_(_VSTD::move(__e)), __n_(0) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
@@ -2944,7 +2944,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit independent_bits_engine(_Engine&& __e)
-        : __e_(_STD::move(__e)) {}
+        : __e_(_VSTD::move(__e)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
@@ -3167,7 +3167,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit shuffle_order_engine(_Engine&& __e)
-        : __e_(_STD::move(__e)) {__init();}
+        : __e_(_VSTD::move(__e)) {__init();}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
@@ -3292,7 +3292,7 @@
     const shuffle_order_engine<_Eng, _K>& __x,
     const shuffle_order_engine<_Eng, _K>& __y)
 {
-    return __x._Y_ == __y._Y_ && _STD::equal(__x._V_, __x._V_ + _K, __y._V_) &&
+    return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _K, __y._V_) &&
            __x.__e_ == __y.__e_;
 }
 
@@ -3418,7 +3418,7 @@
     template<class _OutputIterator>
         _LIBCPP_INLINE_VISIBILITY
         void param(_OutputIterator __dest) const
-            {_STD::copy(__v_.begin(), __v_.end(), __dest);}
+            {_VSTD::copy(__v_.begin(), __v_.end(), __dest);}
 
 private:
     // no copy functions
@@ -3443,7 +3443,7 @@
 {
     if (__first != __last)
     {
-        _STD::fill(__first, __last, 0x8b8b8b8b);
+        _VSTD::fill(__first, __last, 0x8b8b8b8b);
         const size_t __n = static_cast<size_t>(__last - __first);
         const size_t __s = __v_.size();
         const size_t __t = (__n >= 623) ? 11
@@ -3453,7 +3453,7 @@
                          : (__n - 1) / 2;
         const size_t __p = (__n - __t) / 2;
         const size_t __q = __p + __t;
-        const size_t __m = _STD::max(__s + 1, __n);
+        const size_t __m = _VSTD::max(__s + 1, __n);
         // __k = 0;
         {
             result_type __r = 1664525 * _T(__first[0] ^ __first[__p]
@@ -3639,7 +3639,7 @@
 uniform_real_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
     return (__p.b() - __p.a())
-        * _STD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g)
+        * _VSTD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g)
         + __p.a();
 }
 
@@ -3871,9 +3871,9 @@
     if (0 < __p_ && __p_ < 1)
     {
         __r0_ = static_cast<result_type>((__t_ + 1) * __p_);
-        __pr_ = _STD::exp(_STD::lgamma(__t_ + 1.) - _STD::lgamma(__r0_ + 1.) -
-                          _STD::lgamma(__t_ - __r0_ + 1.) + __r0_ * _STD::log(__p_) +
-                          (__t_ - __r0_) * _STD::log(1 - __p_));
+        __pr_ = _VSTD::exp(_VSTD::lgamma(__t_ + 1.) - _VSTD::lgamma(__r0_ + 1.) -
+                          _VSTD::lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) +
+                          (__t_ - __r0_) * _VSTD::log(1 - __p_));
         __odds_ratio_ = __p_ / (1 - __p_);
     }
 }
@@ -4025,10 +4025,10 @@
 _RealType
 exponential_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    return -_STD::log
+    return -_VSTD::log
                   (
                       result_type(1) -
-                      _STD::generate_canonical<result_type,
+                      _VSTD::generate_canonical<result_type,
                                        numeric_limits<result_type>::digits>(__g)
                   )
                   / __p.lambda();
@@ -4180,7 +4180,7 @@
             __v = _Uni(__g);
             __s = __u * __u + __v * __v;
         } while (__s > 1 || __s == 0);
-        result_type _F = _STD::sqrt(-2 * _STD::log(__s) / __s);
+        result_type _F = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
         _V_ = __v * _F;
         _V_hot_ = true;
         _U = __u * _F;
@@ -4297,7 +4297,7 @@
     template<class _URNG>
         _LIBCPP_INLINE_VISIBILITY
         result_type operator()(_URNG& __g, const param_type& __p)
-        {return _STD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));}
+        {return _VSTD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));}
 
     // property functions
     _LIBCPP_INLINE_VISIBILITY
@@ -4446,7 +4446,7 @@
     {
         __s_ = 0;
         __d_ = 0;
-        __l_ = _STD::exp(-__mean_);
+        __l_ = _VSTD::exp(-__mean_);
         __omega_ = 0;
         __c3_ = 0;
         __c2_ = 0;
@@ -4456,7 +4456,7 @@
     }
     else
     {
-        __s_ = _STD::sqrt(__mean_);
+        __s_ = _VSTD::sqrt(__mean_);
         __d_ = 6 * __mean_ * __mean_;
         __l_ = static_cast<result_type>(__mean_ - 1.1484);
         __omega_ = .3989423 / __s_;
@@ -4523,20 +4523,20 @@
                 const result_type __fac[] = {1, 1, 2, 6, 24, 120, 720, 5040,
                                              40320, 362880};
                 __px = -__pr.__mean_;
-                __py = _STD::pow(__pr.__mean_, (double)__x) / __fac[__x];
+                __py = _VSTD::pow(__pr.__mean_, (double)__x) / __fac[__x];
             }
             else
             {
                 double __del = .8333333E-1 / __x;
                 __del -= 4.8 * __del * __del * __del;
                 double __v = __difmuk / __x;
-                if (_STD::abs(__v) > 0.25)
-                    __px = __x * _STD::log(1 + __v) - __difmuk - __del;
+                if (_VSTD::abs(__v) > 0.25)
+                    __px = __x * _VSTD::log(1 + __v) - __difmuk - __del;
                 else
                     __px = __x * __v * __v * (((((((.1250060 * __v + -.1384794) *
                            __v + .1421878) * __v + -.1661269) * __v + .2000118) *
                            __v + -.2500068) * __v + .3333333) * __v + -.5) - __del;
-                __py = .3989423 / _STD::sqrt(__x);
+                __py = .3989423 / _VSTD::sqrt(__x);
             }
             double __r = (0.5 - __difmuk) / __pr.__s_;
             double __r2 = __r * __r;
@@ -4545,13 +4545,13 @@
                                         __r2 + __pr.__c1_) * __r2 + __pr.__c0_);
             if (__using_exp_dist)
             {
-                if (__pr.__c_ * _STD::abs(__u) <= __py * _STD::exp(__px + __e) -
-                                                   __fy * _STD::exp(__fx + __e))
+                if (__pr.__c_ * _VSTD::abs(__u) <= __py * _VSTD::exp(__px + __e) -
+                                                   __fy * _VSTD::exp(__fx + __e))
                     break;
             }
             else
             {
-                if (__fy - __u * __fy <= __py * _STD::exp(__px - __fx))
+                if (__fy - __u * __fy <= __py * _VSTD::exp(__px - __fx))
                     break;
             }
         }
@@ -4642,7 +4642,7 @@
         _LIBCPP_INLINE_VISIBILITY
         result_type operator()(_URNG& __g, const param_type& __p)
         {return __p.b() *
-            _STD::pow(exponential_distribution<result_type>()(__g), 1/__p.a());}
+            _VSTD::pow(exponential_distribution<result_type>()(__g), 1/__p.a());}
 
     // property functions
     _LIBCPP_INLINE_VISIBILITY
@@ -4786,7 +4786,7 @@
 extreme_value_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
     return __p.a() - __p.b() *
-         _STD::log(-_STD::log(1-uniform_real_distribution<result_type>()(__g)));
+         _VSTD::log(-_VSTD::log(1-uniform_real_distribution<result_type>()(__g)));
 }
 
 template <class _CharT, class _Traits, class _RT>
@@ -4923,7 +4923,7 @@
             const result_type __w = __u * (1 - __u);
             if (__w != 0)
             {
-                const result_type __y = _STD::sqrt(__c / __w) *
+                const result_type __y = _VSTD::sqrt(__c / __w) *
                                         (__u - result_type(0.5));
                 __x = __b + __y;
                 if (__x >= 0)
@@ -4931,7 +4931,7 @@
                     const result_type __z = 64 * __w * __w * __w * __v * __v;
                     if (__z <= 1 - 2 * __y * __y / __x)
                         break;
-                    if (_STD::log(__z) <= 2 * (__b * _STD::log(__x / __b) - __y))
+                    if (_VSTD::log(__z) <= 2 * (__b * _VSTD::log(__x / __b) - __y))
                         break;
                 }
             }
@@ -4945,14 +4945,14 @@
             const result_type __es = __egen(__g);
             if (__u <= 1 - __a)
             {
-                __x = _STD::pow(__u, 1 / __a);
+                __x = _VSTD::pow(__u, 1 / __a);
                 if (__x <= __es)
                     break;
             }
             else
             {
-                const result_type __e = -_STD::log((1-__u)/__a);
-                __x = _STD::pow(1 - __a + __a * __e, 1 / __a);
+                const result_type __e = -_VSTD::log((1-__u)/__a);
+                __x = _VSTD::pow(1 - __a + __a * __e, 1 / __a);
                 if (__x <= __e + __es)
                     break;
             }
@@ -5424,7 +5424,7 @@
 {
     uniform_real_distribution<result_type> __gen;
     // purposefully let tan arg get as close to pi/2 as it wants, tan will return a finite
-    return __p.a() + __p.b() * _STD::tan(3.1415926535897932384626433832795 * __gen(__g));
+    return __p.a() + __p.b() * _VSTD::tan(3.1415926535897932384626433832795 * __gen(__g));
 }
 
 template <class _CharT, class _Traits, class _RT>
@@ -5662,7 +5662,7 @@
 student_t_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
     gamma_distribution<result_type> __gd(__p.n() * .5, 2);
-    return __nd_(__g) * _STD::sqrt(__p.n()/__gd(__g));
+    return __nd_(__g) * _VSTD::sqrt(__p.n()/__gd(__g));
 }
 
 template <class _CharT, class _Traits, class _RT>
@@ -5843,12 +5843,12 @@
     {
         if (__p_.size() > 1)
         {
-            double __s = _STD::accumulate(__p_.begin(), __p_.end(), 0.0);
-            for (_STD::vector<double>::iterator __i = __p_.begin(), __e = __p_.end();
+            double __s = _VSTD::accumulate(__p_.begin(), __p_.end(), 0.0);
+            for (_VSTD::vector<double>::iterator __i = __p_.begin(), __e = __p_.end();
                                                                        __i < __e; ++__i)
                 *__i /= __s;
             vector<double> __t(__p_.size() - 1);
-            _STD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
+            _VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
             swap(__p_, __t);
         }
         else
@@ -5864,8 +5864,8 @@
 discrete_distribution<_IntType>::param_type::probabilities() const
 {
     size_t __n = __p_.size();
-    _STD::vector<double> __p(__n+1);
-    _STD::adjacent_difference(__p_.begin(), __p_.end(), __p.begin());
+    _VSTD::vector<double> __p(__n+1);
+    _VSTD::adjacent_difference(__p_.begin(), __p_.end(), __p.begin());
     if (__n > 0)
         __p[__n] = 1 - __p_[__n-1];
     else
@@ -5880,7 +5880,7 @@
 {
     uniform_real_distribution<double> __gen;
     return static_cast<_IntType>(
-           _STD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) -
+           _VSTD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) -
                                                               __p.__p_.begin());
 }
 
@@ -6079,14 +6079,14 @@
 piecewise_constant_distribution<_RealType>::param_type::__init()
 {
     // __densities_ contains non-normalized areas
-    result_type __total_area = _STD::accumulate(__densities_.begin(),
+    result_type __total_area = _VSTD::accumulate(__densities_.begin(),
                                                 __densities_.end(),
                                                 result_type());
     for (size_t __i = 0; __i < __densities_.size(); ++__i)
         __densities_[__i] /= __total_area;
     // __densities_ contains normalized areas
     __areas_.assign(__densities_.size(), result_type());
-    _STD::partial_sum(__densities_.begin(), __densities_.end() - 1,
+    _VSTD::partial_sum(__densities_.begin(), __densities_.end() - 1,
                                                           __areas_.begin() + 1);
     // __areas_ contains partial sums of normalized areas: [0, __densities_ - 1]
     __densities_.back() = 1 - __areas_.back();  // correct round off error
@@ -6175,7 +6175,7 @@
 {
     typedef uniform_real_distribution<result_type> _Gen;
     result_type __u = _Gen()(__g);
-    ptrdiff_t __k = _STD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
+    ptrdiff_t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
                                       __u) - __p.__areas_.begin() - 1;
     return (__u - __p.__areas_[__k]) / __p.__densities_[__k] + __p.__b_[__k];
 }
@@ -6496,7 +6496,7 @@
 {
     typedef uniform_real_distribution<result_type> _Gen;
     result_type __u = _Gen()(__g);
-    ptrdiff_t __k = _STD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
+    ptrdiff_t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
                                       __u) - __p.__areas_.begin() - 1;
     __u -= __p.__areas_[__k];
     const result_type __dk = __p.__densities_[__k];
@@ -6508,7 +6508,7 @@
     const result_type __bk1 = __p.__b_[__k+1];
     const result_type __deltab = __bk1 - __bk;
     return (__bk * __dk1 - __bk1 * __dk +
-        _STD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) /
+        _VSTD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) /
         __deltad;
 }
 
diff --git a/include/regex b/include/regex
index c4c58a4..9eef160 100644
--- a/include/regex
+++ b/include/regex
@@ -1280,7 +1280,7 @@
     __node(const __node&);
     __node& operator=(const __node&);
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __node() {}
@@ -1300,7 +1300,7 @@
     : public __node<_CharT>
 {
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __end_state() {}
@@ -1365,7 +1365,7 @@
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __empty_state(__node<_CharT>* __s)
@@ -1391,7 +1391,7 @@
     typedef __has_one_state<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __empty_non_own_state(__node<_CharT>* __s)
@@ -1417,7 +1417,7 @@
     typedef __has_one_state<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __repeat_one_loop(__node<_CharT>* __s)
@@ -1479,7 +1479,7 @@
     bool __greedy_;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __loop(unsigned __loop_id,
@@ -1578,7 +1578,7 @@
     typedef __owns_two_states<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __alternate(__owns_one_state<_CharT>* __s1,
@@ -1617,7 +1617,7 @@
 
     unsigned __mexp_;
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __begin_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
@@ -1645,7 +1645,7 @@
 
     unsigned __mexp_;
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __end_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
@@ -1674,7 +1674,7 @@
 
     unsigned __mexp_;
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __back_ref(unsigned __mexp, __node<_CharT>* __s)
@@ -1692,7 +1692,7 @@
     {
         ptrdiff_t __len = __sm.second - __sm.first;
         if (__s.__last_ - __s.__current_ >= __len &&
-            _STD::equal(__sm.first, __sm.second, __s.__current_))
+            _VSTD::equal(__sm.first, __sm.second, __s.__current_))
         {
             __s.__do_ = __state::__accept_but_not_consume;
             __s.__current_ += __len;
@@ -1722,7 +1722,7 @@
     _Traits __traits_;
     unsigned __mexp_;
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __back_ref_icase(const _Traits& __traits, unsigned __mexp,
@@ -1777,7 +1777,7 @@
     _Traits __traits_;
     unsigned __mexp_;
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __back_ref_collate(const _Traits& __traits, unsigned __mexp,
@@ -1832,7 +1832,7 @@
     _Traits __traits_;
     bool __invert_;
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit __word_boundary(const _Traits& __traits, bool __invert,
@@ -1900,7 +1900,7 @@
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __l_anchor(__node<_CharT>* __s)
@@ -1934,7 +1934,7 @@
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __r_anchor(__node<_CharT>* __s)
@@ -1968,7 +1968,7 @@
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __match_any(__node<_CharT>* __s)
@@ -2003,7 +2003,7 @@
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __match_any_but_newline(__node<_CharT>* __s)
@@ -2025,7 +2025,7 @@
     __match_char(const __match_char&);
     __match_char& operator=(const __match_char&);
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __match_char(_CharT __c, __node<_CharT>* __s)
@@ -2065,7 +2065,7 @@
     __match_char_icase(const __match_char_icase&);
     __match_char_icase& operator=(const __match_char_icase&);
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
@@ -2106,7 +2106,7 @@
     __match_char_collate(const __match_char_collate&);
     __match_char_collate& operator=(const __match_char_collate&);
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
@@ -2158,7 +2158,7 @@
     __bracket_expression(const __bracket_expression&);
     __bracket_expression& operator=(const __bracket_expression&);
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __bracket_expression(const _Traits& __traits, __node<_CharT>* __s,
@@ -2226,7 +2226,7 @@
                     __b[0] = __traits_.translate_nocase(__b[0]);
                     __e[0] = __traits_.translate_nocase(__e[0]);
                 }
-                __ranges_.push_back(make_pair(_STD::move(__b), _STD::move(__e)));
+                __ranges_.push_back(make_pair(_VSTD::move(__b), _VSTD::move(__e)));
             }
         }
     _LIBCPP_INLINE_VISIBILITY
@@ -2263,7 +2263,7 @@
         ++__consumed;
         if (__might_have_digraph_)
         {
-            const _CharT* __next = _STD::next(__s.__current_);
+            const _CharT* __next = _VSTD::next(__s.__current_);
             if (__next != __s.__last_)
             {
                 pair<_CharT, _CharT> __ch2(*__s.__current_, *__next);
@@ -2430,8 +2430,8 @@
     shared_ptr<__empty_state<_CharT> > __start_;
     __owns_one_state<_CharT>* __end_;
 
-    typedef _STD::__state<_CharT> __state;
-    typedef _STD::__node<_CharT> __node;
+    typedef _VSTD::__state<_CharT> __state;
+    typedef _VSTD::__node<_CharT> __node;
 
 public:
     // constants:
@@ -2834,7 +2834,7 @@
 void
 basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
 {
-    using _STD::swap;
+    using _VSTD::swap;
     swap(__traits_, __r.__traits_);
     swap(__flags_, __r.__flags_);
     swap(__marked_count_, __r.__marked_count_);
@@ -2866,7 +2866,7 @@
     __lookahead(const __lookahead&);
     __lookahead& operator=(const __lookahead&);
 public:
-    typedef _STD::__state<_CharT> __state;
+    typedef _VSTD::__state<_CharT> __state;
 
     _LIBCPP_INLINE_VISIBILITY
     __lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s)
@@ -2953,7 +2953,7 @@
             __first = __parse_RE_expression(__first, __last);
             if (__first != __last)
             {
-                _ForwardIterator __temp = _STD::next(__first);
+                _ForwardIterator __temp = _VSTD::next(__first);
                 if (__temp == __last && *__first == '$')
                 {
                     __push_r_anchor();
@@ -3182,7 +3182,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '(')
@@ -3200,7 +3200,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == ')')
@@ -3218,7 +3218,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '{')
@@ -3236,7 +3236,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '}')
@@ -3254,7 +3254,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && '1' <= *__temp && *__temp <= '9')
@@ -3275,7 +3275,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp == __last && *__first == '$')
             return __first;
         // Not called inside a bracket
@@ -3333,7 +3333,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\')
@@ -3364,7 +3364,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\')
@@ -3674,7 +3674,7 @@
 {
     if (__first != __last && *__first != ']')
     {
-        _ForwardIterator __temp = _STD::next(__first);
+        _ForwardIterator __temp = _VSTD::next(__first);
         basic_string<_CharT> __start_range;
         if (__temp != __last && *__first == '[')
         {
@@ -3703,7 +3703,7 @@
         }
         if (__first != __last && *__first != ']')
         {
-            __temp = _STD::next(__first);
+            __temp = _VSTD::next(__first);
             if (__temp != __last && *__first == '-' && *__temp != ']')
             {
                 // parse a range
@@ -3729,7 +3729,7 @@
                         ++__first;
                     }
                 }
-                __ml->__add_range(_STD::move(__start_range), _STD::move(__end_range));
+                __ml->__add_range(_VSTD::move(__start_range), _VSTD::move(__end_range));
             }
             else
             {
@@ -3890,7 +3890,7 @@
     // Found [=
     //   This means =] must exist
     value_type _Equal_close[2] = {'=', ']'};
-    _ForwardIterator __temp = _STD::search(__first, __last, _Equal_close,
+    _ForwardIterator __temp = _VSTD::search(__first, __last, _Equal_close,
                                                             _Equal_close+2);
 #ifndef _LIBCPP_NO_EXCEPTIONS
     if (__temp == __last)
@@ -3925,7 +3925,7 @@
 #endif  // _LIBCPP_NO_EXCEPTIONS
         }
     }
-    __first = _STD::next(__temp, 2);
+    __first = _VSTD::next(__temp, 2);
     return __first;
 }
 
@@ -3939,7 +3939,7 @@
     // Found [:
     //   This means :] must exist
     value_type _Colon_close[2] = {':', ']'};
-    _ForwardIterator __temp = _STD::search(__first, __last, _Colon_close,
+    _ForwardIterator __temp = _VSTD::search(__first, __last, _Colon_close,
                                                             _Colon_close+2);
 #ifndef _LIBCPP_NO_EXCEPTIONS
     if (__temp == __last)
@@ -3954,7 +3954,7 @@
         throw regex_error(regex_constants::error_brack);
 #endif  // _LIBCPP_NO_EXCEPTIONS
     __ml->__add_class(__class_type);
-    __first = _STD::next(__temp, 2);
+    __first = _VSTD::next(__temp, 2);
     return __first;
 }
 
@@ -3968,7 +3968,7 @@
     // Found [.
     //   This means .] must exist
     value_type _Dot_close[2] = {'.', ']'};
-    _ForwardIterator __temp = _STD::search(__first, __last, _Dot_close,
+    _ForwardIterator __temp = _VSTD::search(__first, __last, _Dot_close,
                                                             _Dot_close+2);
 #ifndef _LIBCPP_NO_EXCEPTIONS
     if (__temp == __last)
@@ -3987,7 +3987,7 @@
         throw regex_error(regex_constants::error_collate);
 #endif  // _LIBCPP_NO_EXCEPTIONS
     }
-    __first = _STD::next(__temp, 2);
+    __first = _VSTD::next(__temp, 2);
     return __first;
 }
 
@@ -4091,7 +4091,7 @@
             break;
         case '\\':
             {
-                _ForwardIterator __temp = _STD::next(__first);
+                _ForwardIterator __temp = _VSTD::next(__first);
                 if (__temp != __last)
                 {
                     if (*__temp == 'b')
@@ -4109,7 +4109,7 @@
             break;
         case '(':
             {
-                _ForwardIterator __temp = _STD::next(__first);
+                _ForwardIterator __temp = _VSTD::next(__first);
                 if (__temp != __last && *__temp == '?')
                 {
                     if (++__temp != __last)
@@ -4121,7 +4121,7 @@
                                 basic_regex __exp;
                                 __exp.__flags_ = __flags_;
                                 __temp = __exp.__parse(++__temp, __last);
-                                __push_lookahead(_STD::move(__exp), false);
+                                __push_lookahead(_VSTD::move(__exp), false);
 #ifndef _LIBCPP_NO_EXCEPTIONS
                                 if (__temp == __last || *__temp != ')')
                                     throw regex_error(regex_constants::error_paren);
@@ -4134,7 +4134,7 @@
                                 basic_regex __exp;
                                 __exp.__flags_ = __flags_;
                                 __temp = __exp.__parse(++__temp, __last);
-                                __push_lookahead(_STD::move(__exp), true);
+                                __push_lookahead(_VSTD::move(__exp), true);
 #ifndef _LIBCPP_NO_EXCEPTIONS
                                 if (__temp == __last || *__temp != ')')
                                     throw regex_error(regex_constants::error_paren);
@@ -4179,7 +4179,7 @@
                 if (__first == __last)
                     throw regex_error(regex_constants::error_paren);
 #endif  // _LIBCPP_NO_EXCEPTIONS
-                _ForwardIterator __temp = _STD::next(__first);
+                _ForwardIterator __temp = _VSTD::next(__first);
                 if (__temp != __last && *__first == '?' && *__temp == ':')
                 {
                     ++__open_count_;
@@ -4223,7 +4223,7 @@
 {
     if (__first != __last && *__first == '\\')
     {
-        _ForwardIterator __t1 = _STD::next(__first);
+        _ForwardIterator __t1 = _VSTD::next(__first);
         _ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
         if (__t2 != __t1)
             __first = __t2;
@@ -4369,7 +4369,7 @@
             ++__first;
             break;
         case 'c':
-            if ((__t = _STD::next(__first)) != __last)
+            if ((__t = _VSTD::next(__first)) != __last)
             {
                 if ('A' <= *__t <= 'Z' || 'a' <= *__t <= 'z')
                 {
@@ -4494,7 +4494,7 @@
                                            _ForwardIterator __last)
 {
     __owns_one_state<_CharT>* __sa = __end_;
-    _ForwardIterator __t1 = _STD::find(__first, __last, _CharT('\n'));
+    _ForwardIterator __t1 = _VSTD::find(__first, __last, _CharT('\n'));
     if (__t1 != __first)
         __parse_basic_reg_exp(__first, __t1);
     else
@@ -4504,7 +4504,7 @@
         ++__first;
     while (__first != __last)
     {
-        __t1 = _STD::find(__first, __last, _CharT('\n'));
+        __t1 = _VSTD::find(__first, __last, _CharT('\n'));
         __owns_one_state<_CharT>* __sb = __end_;
         if (__t1 != __first)
             __parse_basic_reg_exp(__first, __t1);
@@ -4525,7 +4525,7 @@
                                             _ForwardIterator __last)
 {
     __owns_one_state<_CharT>* __sa = __end_;
-    _ForwardIterator __t1 = _STD::find(__first, __last, _CharT('\n'));
+    _ForwardIterator __t1 = _VSTD::find(__first, __last, _CharT('\n'));
     if (__t1 != __first)
         __parse_extended_reg_exp(__first, __t1);
     else
@@ -4535,7 +4535,7 @@
         ++__first;
     while (__first != __last)
     {
-        __t1 = _STD::find(__first, __last, _CharT('\n'));
+        __t1 = _VSTD::find(__first, __last, _CharT('\n'));
         __owns_one_state<_CharT>* __sb = __end_;
         if (__t1 != __first)
             __parse_extended_reg_exp(__first, __t1);
@@ -4732,7 +4732,7 @@
 
     _LIBCPP_INLINE_VISIBILITY
     difference_type length() const
-        {return matched ? _STD::distance(this->first, this->second) : 0;}
+        {return matched ? _VSTD::distance(this->first, this->second) : 0;}
     _LIBCPP_INLINE_VISIBILITY
     string_type str() const
         {return matched ? string_type(this->first, this->second) : string_type();}
@@ -5188,7 +5188,7 @@
         {return (*this)[__sub].length();}
     _LIBCPP_INLINE_VISIBILITY
     difference_type position(size_type __sub = 0) const
-        {return _STD::distance(__position_start_, (*this)[__sub].first);}
+        {return _VSTD::distance(__position_start_, (*this)[__sub].first);}
     _LIBCPP_INLINE_VISIBILITY
     string_type str(size_type __sub = 0) const
         {return (*this)[__sub].str();}
@@ -5260,18 +5260,18 @@
         __matches_.resize(__m.size());
         for (size_type __i = 0; __i < __matches_.size(); ++__i)
         {
-            __matches_[__i].first = _STD::next(__f, _STD::distance(__mf, __m[__i].first));
-            __matches_[__i].second = _STD::next(__f, _STD::distance(__mf, __m[__i].second));
+            __matches_[__i].first = _VSTD::next(__f, _VSTD::distance(__mf, __m[__i].first));
+            __matches_[__i].second = _VSTD::next(__f, _VSTD::distance(__mf, __m[__i].second));
             __matches_[__i].matched = __m[__i].matched;
         }
         __unmatched_.first   = __l;
         __unmatched_.second  = __l;
         __unmatched_.matched = false;
-        __prefix_.first = _STD::next(__f, _STD::distance(__mf, __m.prefix().first));
-        __prefix_.second = _STD::next(__f, _STD::distance(__mf, __m.prefix().second));
+        __prefix_.first = _VSTD::next(__f, _VSTD::distance(__mf, __m.prefix().first));
+        __prefix_.second = _VSTD::next(__f, _VSTD::distance(__mf, __m.prefix().second));
         __prefix_.matched = __m.prefix().matched;
-        __suffix_.first = _STD::next(__f, _STD::distance(__mf, __m.suffix().first));
-        __suffix_.second = _STD::next(__f, _STD::distance(__mf, __m.suffix().second));
+        __suffix_.first = _VSTD::next(__f, _VSTD::distance(__mf, __m.suffix().first));
+        __suffix_.second = _VSTD::next(__f, _VSTD::distance(__mf, __m.suffix().second));
         __suffix_.matched = __m.suffix().matched;
         if (!__no_update_pos)
             __position_start_ = __prefix_.first;
@@ -5342,7 +5342,7 @@
         for (; __fmt_first != __fmt_last; ++__fmt_first)
         {
             if (*__fmt_first == '&')
-                __out = _STD::copy(__matches_[0].first, __matches_[0].second,
+                __out = _VSTD::copy(__matches_[0].first, __matches_[0].second,
                                    __out);
             else if (*__fmt_first == '\\' && __fmt_first + 1 != __fmt_last)
             {
@@ -5350,7 +5350,7 @@
                 if ('0' <= *__fmt_first && *__fmt_first <= '9')
                 {
                     size_t __i = *__fmt_first - '0';
-                    __out = _STD::copy(__matches_[__i].first,
+                    __out = _VSTD::copy(__matches_[__i].first,
                                        __matches_[__i].second, __out);
                 }
                 else
@@ -5380,16 +5380,16 @@
                     break;
                 case '&':
                     ++__fmt_first;
-                    __out = _STD::copy(__matches_[0].first, __matches_[0].second,
+                    __out = _VSTD::copy(__matches_[0].first, __matches_[0].second,
                                        __out);
                     break;
                 case '`':
                     ++__fmt_first;
-                    __out = _STD::copy(__prefix_.first, __prefix_.second, __out);
+                    __out = _VSTD::copy(__prefix_.first, __prefix_.second, __out);
                     break;
                 case '\'':
                     ++__fmt_first;
-                    __out = _STD::copy(__suffix_.first, __suffix_.second, __out);
+                    __out = _VSTD::copy(__suffix_.first, __suffix_.second, __out);
                     break;
                 default:
                     if ('0' <= __fmt_first[1] && __fmt_first[1] <= '9')
@@ -5402,7 +5402,7 @@
                             ++__fmt_first;
                             __i = 10 * __i + *__fmt_first - '0';
                         }
-                        __out = _STD::copy(__matches_[__i].first,
+                        __out = _VSTD::copy(__matches_[__i].first,
                                            __matches_[__i].second, __out);
                     }
                     else
@@ -5427,7 +5427,7 @@
 void
 match_results<_BidirectionalIterator, _Allocator>::swap(match_results& __m)
 {
-    using _STD::swap;
+    using _VSTD::swap;
     swap(__matches_, __m.__matches_);
     swap(__unmatched_, __m.__unmatched_);
     swap(__prefix_, __m.__prefix_);
@@ -5485,7 +5485,7 @@
 {
     vector<__state> __states;
     ptrdiff_t __j = 0;
-    ptrdiff_t _N = _STD::distance(__first, __last);
+    ptrdiff_t _N = _VSTD::distance(__first, __last);
     __node* __st = __start_.get();
     if (__st)
     {
@@ -5509,7 +5509,7 @@
             {
             case __state::__end_state:
                 __m.__matches_[0].first = __first;
-                __m.__matches_[0].second = _STD::next(__first, __s.__current_ - __first);
+                __m.__matches_[0].second = _VSTD::next(__first, __s.__current_ - __first);
                 __m.__matches_[0].matched = true;
                 for (unsigned __i = 0; __i < __s.__sub_matches_.size(); ++__i)
                     __m.__matches_[__i+1] = __s.__sub_matches_[__i];
@@ -5523,7 +5523,7 @@
                 __state __snext = __s;
                 __s.__node_->__exec_split(true, __s);
                 __snext.__node_->__exec_split(false, __snext);
-                __states.push_back(_STD::move(__snext));
+                __states.push_back(_VSTD::move(__snext));
                 }
                 break;
             case __state::__reject:
@@ -5551,7 +5551,7 @@
 {
     deque<__state> __states;
     ptrdiff_t __highest_j = 0;
-    ptrdiff_t _N = _STD::distance(__first, __last);
+    ptrdiff_t _N = _VSTD::distance(__first, __last);
     __node* __st = __start_.get();
     if (__st)
     {
@@ -5584,7 +5584,7 @@
             case __state::__consume_input:
                 break;
             case __state::__accept_and_consume:
-                __states.push_front(_STD::move(__s));
+                __states.push_front(_VSTD::move(__s));
                 __states.pop_back();
                 break;
             case __state::__repeat:
@@ -5595,7 +5595,7 @@
                 __state __snext = __s;
                 __s.__node_->__exec_split(true, __s);
                 __snext.__node_->__exec_split(false, __snext);
-                __states.push_back(_STD::move(__snext));
+                __states.push_back(_VSTD::move(__snext));
                 }
                 break;
             case __state::__reject:
@@ -5611,7 +5611,7 @@
         if (__matched)
         {
             __m.__matches_[0].first = __first;
-            __m.__matches_[0].second = _STD::next(__first, __highest_j);
+            __m.__matches_[0].second = _VSTD::next(__first, __highest_j);
             __m.__matches_[0].matched = true;
             return true;
         }
@@ -5631,7 +5631,7 @@
     __state __best_state;
     ptrdiff_t __j = 0;
     ptrdiff_t __highest_j = 0;
-    ptrdiff_t _N = _STD::distance(__first, __last);
+    ptrdiff_t _N = _VSTD::distance(__first, __last);
     __node* __st = __start_.get();
     if (__st)
     {
@@ -5678,7 +5678,7 @@
                 __state __snext = __s;
                 __s.__node_->__exec_split(true, __s);
                 __snext.__node_->__exec_split(false, __snext);
-                __states.push_back(_STD::move(__snext));
+                __states.push_back(_VSTD::move(__snext));
                 }
                 break;
             case __state::__reject:
@@ -5694,7 +5694,7 @@
         if (__matched)
         {
             __m.__matches_[0].first = __first;
-            __m.__matches_[0].second = _STD::next(__first, __highest_j);
+            __m.__matches_[0].second = _VSTD::next(__first, __highest_j);
             __m.__matches_[0].matched = true;
             for (unsigned __i = 0; __i < __best_state.__sub_matches_.size(); ++__i)
                 __m.__matches_[__i+1] = __best_state.__sub_matches_[__i];
@@ -5824,7 +5824,7 @@
              regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     match_results<const _CharT*> __m;
-    return _STD::regex_search(__str, __m, __e, __flags);
+    return _VSTD::regex_search(__str, __m, __e, __flags);
 }
 
 template <class _ST, class _SA, class _CharT, class _Traits>
@@ -5861,7 +5861,7 @@
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    bool __r = _STD::regex_search(__first, __last, __m, __e,
+    bool __r = _VSTD::regex_search(__first, __last, __m, __e,
                             __flags | regex_constants::match_continuous);
     if (__r)
     {
@@ -5880,7 +5880,7 @@
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     match_results<_BidirectionalIterator> __m;
-    return _STD::regex_match(__first, __last, __m, __e, __flags);
+    return _VSTD::regex_match(__first, __last, __m, __e, __flags);
 }
 
 template <class _CharT, class _Allocator, class _Traits>
@@ -5890,7 +5890,7 @@
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _STD::regex_match(__str, __str + _Traits::length(__str), __m, __e, __flags);
+    return _VSTD::regex_match(__str, __str + _Traits::length(__str), __m, __e, __flags);
 }
 
 template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
@@ -5901,7 +5901,7 @@
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _STD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
+    return _VSTD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
 }
 
 template <class _CharT, class _Traits>
@@ -5910,7 +5910,7 @@
 regex_match(const _CharT* __str, const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _STD::regex_match(__str, __str + _Traits::length(__str), __e, __flags);
+    return _VSTD::regex_match(__str, __str + _Traits::length(__str), __e, __flags);
 }
 
 template <class _ST, class _SA, class _CharT, class _Traits>
@@ -5920,7 +5920,7 @@
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _STD::regex_match(__s.begin(), __s.end(), __e, __flags);
+    return _VSTD::regex_match(__s.begin(), __s.end(), __e, __flags);
 }
 
 // regex_iterator
@@ -5985,7 +5985,7 @@
       __pregex_(&__re),
       __flags_(__m)
 {
-    _STD::regex_search(__begin_, __end_, __match_, *__pregex_, __flags_);
+    _VSTD::regex_search(__begin_, __end_, __match_, *__pregex_, __flags_);
 }
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
@@ -6017,7 +6017,7 @@
             __match_ = value_type();
             return *this;
         }
-        else if (_STD::regex_search(__start, __end_, __match_, *__pregex_,
+        else if (_VSTD::regex_search(__start, __end_, __match_, *__pregex_,
                                     __flags_ | regex_constants::match_not_null |
                                     regex_constants::match_continuous))
             return *this;
@@ -6025,7 +6025,7 @@
             ++__start;
     }
     __flags_ |= regex_constants::match_prev_avail;
-    if (!_STD::regex_search(__start, __end_, __match_, *__pregex_, __flags_))
+    if (!_VSTD::regex_search(__start, __end_, __match_, *__pregex_, __flags_))
         __match_ = value_type();
     return *this;
 }
@@ -6267,7 +6267,7 @@
         }
         else
         {
-            if (_STD::find(__subs_.begin(), __subs_.end(), -1) != __subs_.end()
+            if (_VSTD::find(__subs_.begin(), __subs_.end(), -1) != __subs_.end()
                 && __prev->suffix().length() != 0)
             {
                 __suffix_.matched = true;
@@ -6303,7 +6303,7 @@
     if (__i == __eof)
     {
         if (!(__flags & regex_constants::format_no_copy))
-            __out = _STD::copy(__first, __last, __out);
+            __out = _VSTD::copy(__first, __last, __out);
     }
     else
     {
@@ -6311,14 +6311,14 @@
         for (size_t __len = char_traits<_CharT>::length(__fmt); __i != __eof; ++__i)
         {
             if (!(__flags & regex_constants::format_no_copy))
-                __out = _STD::copy(__i->prefix().first, __i->prefix().second, __out);
+                __out = _VSTD::copy(__i->prefix().first, __i->prefix().second, __out);
             __out = __i->format(__out, __fmt, __fmt + __len, __flags);
             __lm = __i->suffix();
             if (__flags & regex_constants::format_first_only)
                 break;
         }
         if (!(__flags & regex_constants::format_no_copy))
-            __out = _STD::copy(__lm.first, __lm.second, __out);
+            __out = _VSTD::copy(__lm.first, __lm.second, __out);
     }
     return __out;
 }
@@ -6333,7 +6333,7 @@
               const basic_string<_CharT, _ST, _SA>& __fmt,
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _STD::regex_replace(__out, __first, __last, __e, __fmt.c_str(), __flags);
+    return _VSTD::regex_replace(__out, __first, __last, __e, __fmt.c_str(), __flags);
 }
 
 template <class _Traits, class _CharT, class _ST, class _SA, class _FST,
@@ -6346,7 +6346,7 @@
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT, _ST, _SA> __r;
-    _STD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
+    _VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
                         __fmt.c_str(), __flags);
     return __r;
 }
@@ -6359,7 +6359,7 @@
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT, _ST, _SA> __r;
-    _STD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
+    _VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
                         __fmt, __flags);
     return __r;
 }
@@ -6373,7 +6373,7 @@
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT> __r;
-    _STD::regex_replace(back_inserter(__r), __s,
+    _VSTD::regex_replace(back_inserter(__r), __s,
                         __s + char_traits<_CharT>::length(__s), __e,
                         __fmt.c_str(), __flags);
     return __r;
@@ -6388,7 +6388,7 @@
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT> __r;
-    _STD::regex_replace(back_inserter(__r), __s,
+    _VSTD::regex_replace(back_inserter(__r), __s,
                         __s + char_traits<_CharT>::length(__s), __e,
                         __fmt, __flags);
     return __r;
diff --git a/include/scoped_allocator b/include/scoped_allocator
index e882295..9427a37 100644
--- a/include/scoped_allocator
+++ b/include/scoped_allocator
@@ -194,7 +194,7 @@
         _LIBCPP_INLINE_VISIBILITY
         __scoped_allocator_storage(_OuterA2&& __outerAlloc,
                                    const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
-            : outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)),
+            : outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)),
               __inner_(__innerAllocs...) {}
 
     template <class _OuterA2,
@@ -214,8 +214,8 @@
         _LIBCPP_INLINE_VISIBILITY
         __scoped_allocator_storage(
             __scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
-            : outer_allocator_type(_STD::move(__other.outer_allocator())),
-              __inner_(_STD::move(__other.inner_allocator())) {}
+            : outer_allocator_type(_VSTD::move(__other.outer_allocator())),
+              __inner_(_VSTD::move(__other.inner_allocator())) {}
 
     template <class _OuterA2,
               class = typename enable_if<
@@ -224,7 +224,7 @@
         _LIBCPP_INLINE_VISIBILITY
         __scoped_allocator_storage(_OuterA2&& __o,
                                    const inner_allocator_type& __i) _NOEXCEPT
-            : outer_allocator_type(_STD::forward<_OuterA2>(__o)),
+            : outer_allocator_type(_VSTD::forward<_OuterA2>(__o)),
               __inner_(__i)
         {
         }
@@ -274,7 +274,7 @@
                       >::type>
         _LIBCPP_INLINE_VISIBILITY
         __scoped_allocator_storage(_OuterA2&& __outerAlloc) _NOEXCEPT
-            : outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)) {}
+            : outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)) {}
 
     template <class _OuterA2,
               class = typename enable_if<
@@ -292,7 +292,7 @@
         _LIBCPP_INLINE_VISIBILITY
         __scoped_allocator_storage(
             __scoped_allocator_storage<_OuterA2>&& __other) _NOEXCEPT
-            : outer_allocator_type(_STD::move(__other.outer_allocator())) {}
+            : outer_allocator_type(_VSTD::move(__other.outer_allocator())) {}
 
     _LIBCPP_INLINE_VISIBILITY
     inner_allocator_type& inner_allocator() _NOEXCEPT
@@ -354,7 +354,7 @@
 {
     typedef typename remove_reference
                      <
-                        decltype(_STD::declval<_Alloc>().outer_allocator())
+                        decltype(_VSTD::declval<_Alloc>().outer_allocator())
                      >::type                                    _OuterAlloc;
     typedef typename __outermost<_OuterAlloc>::type             type;
     _LIBCPP_INLINE_VISIBILITY
@@ -414,7 +414,7 @@
         _LIBCPP_INLINE_VISIBILITY
         scoped_allocator_adaptor(_OuterA2&& __outerAlloc,
                                  const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
-            : base(_STD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
+            : base(_VSTD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
     // scoped_allocator_adaptor(const scoped_allocator_adaptor& __other) = default;
     template <class _OuterA2,
               class = typename enable_if<
@@ -431,7 +431,7 @@
         _LIBCPP_INLINE_VISIBILITY
         scoped_allocator_adaptor(
             scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
-                : base(_STD::move(__other)) {}
+                : base(_VSTD::move(__other)) {}
 
     // ~scoped_allocator_adaptor() = default;
 
@@ -471,7 +471,7 @@
         _LIBCPP_INLINE_VISIBILITY
         void construct(_Tp* __p, _Args&& ...__args)
             {__construct(__uses_alloc_ctor<_Tp, inner_allocator_type, _Args...>(),
-                         __p, _STD::forward<_Args>(__args)...);}
+                         __p, _VSTD::forward<_Args>(__args)...);}
     template <class _Tp>
         _LIBCPP_INLINE_VISIBILITY
         void destroy(_Tp* __p)
@@ -494,7 +494,7 @@
     _LIBCPP_INLINE_VISIBILITY
     scoped_allocator_adaptor(_OuterA2&& __o,
                              const inner_allocator_type& __i) _NOEXCEPT
-        : base(_STD::forward<_OuterA2>(__o), __i) {}
+        : base(_VSTD::forward<_OuterA2>(__o), __i) {}
 
     template <class _Tp, class... _Args>
         _LIBCPP_INLINE_VISIBILITY
@@ -505,7 +505,7 @@
                 (
                     _OM()(outer_allocator()),
                     __p,
-                    _STD::forward<_Args>(__args)...
+                    _VSTD::forward<_Args>(__args)...
                 );
             }
 
@@ -520,7 +520,7 @@
                     __p,
                     allocator_arg,
                     inner_allocator(),
-                    _STD::forward<_Args>(__args)...
+                    _VSTD::forward<_Args>(__args)...
                 );
             }
 
@@ -533,7 +533,7 @@
                 (
                     _OM()(outer_allocator()),
                     __p,
-                    _STD::forward<_Args>(__args)...,
+                    _VSTD::forward<_Args>(__args)...,
                     inner_allocator()
                 );
             }
diff --git a/include/set b/include/set
index 0f8a19a..717703f 100644
--- a/include/set
+++ b/include/set
@@ -370,8 +370,8 @@
     typedef typename __base::difference_type       difference_type;
     typedef typename __base::const_iterator        iterator;
     typedef typename __base::const_iterator        const_iterator;
-    typedef _STD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
 
     _LIBCPP_INLINE_VISIBILITY
     explicit set(const value_compare& __comp = value_compare())
@@ -412,7 +412,7 @@
     _LIBCPP_INLINE_VISIBILITY
     set(set&& __s)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_STD::move(__s.__tree_)) {}
+        : __tree_(_VSTD::move(__s.__tree_)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
@@ -457,7 +457,7 @@
     set& operator=(set&& __s)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _STD::move(__s.__tree_);
+            __tree_ = _VSTD::move(__s.__tree_);
             return *this;
         }
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -505,11 +505,11 @@
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool> emplace(_Args&&... __args)
-            {return __tree_.__emplace_unique(_STD::forward<_Args>(__args)...);}
+            {return __tree_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
-            {return __tree_.__emplace_hint_unique(__p, _STD::forward<_Args>(__args)...);}
+            {return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);}
 #endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator,bool> insert(const value_type& __v)
@@ -517,7 +517,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator,bool> insert(value_type&& __v)
-        {return __tree_.__insert_unique(_STD::move(__v));}
+        {return __tree_.__insert_unique(_VSTD::move(__v));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __v)
@@ -525,7 +525,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, value_type&& __v)
-        {return __tree_.__insert_unique(__p, _STD::move(__v));}
+        {return __tree_.__insert_unique(__p, _VSTD::move(__v));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
@@ -593,13 +593,13 @@
 
 template <class _Key, class _Compare, class _Allocator>
 set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
-    : __tree_(_STD::move(__s.__tree_), __a)
+    : __tree_(_VSTD::move(__s.__tree_), __a)
 {
     if (__a != __s.get_allocator())
     {
         const_iterator __e = cend();
         while (!__s.empty())
-            insert(__e, _STD::move(__s.__tree_.remove(__s.begin())->__value_));
+            insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
     }
 }
 
@@ -611,7 +611,7 @@
 operator==(const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Compare, class _Allocator>
@@ -620,7 +620,7 @@
 operator< (const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Compare, class _Allocator>
@@ -698,8 +698,8 @@
     typedef typename __base::difference_type       difference_type;
     typedef typename __base::const_iterator        iterator;
     typedef typename __base::const_iterator        const_iterator;
-    typedef _STD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
 
     // construct/copy/destroy:
     _LIBCPP_INLINE_VISIBILITY
@@ -742,7 +742,7 @@
     _LIBCPP_INLINE_VISIBILITY
     multiset(multiset&& __s)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_STD::move(__s.__tree_)) {}
+        : __tree_(_VSTD::move(__s.__tree_)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit multiset(const allocator_type& __a)
@@ -784,7 +784,7 @@
     multiset& operator=(multiset&& __s)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _STD::move(__s.__tree_);
+            __tree_ = _VSTD::move(__s.__tree_);
             return *this;
         }
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -832,11 +832,11 @@
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace(_Args&&... __args)
-            {return __tree_.__emplace_multi(_STD::forward<_Args>(__args)...);}
+            {return __tree_.__emplace_multi(_VSTD::forward<_Args>(__args)...);}
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
-            {return __tree_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
+            {return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
 #endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const value_type& __v)
@@ -844,7 +844,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(value_type&& __v)
-        {return __tree_.__insert_multi(_STD::move(__v));}
+        {return __tree_.__insert_multi(_VSTD::move(__v));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __v)
@@ -852,7 +852,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, value_type&& __v)
-        {return __tree_.__insert_multi(_STD::move(__v));}
+        {return __tree_.__insert_multi(_VSTD::move(__v));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
@@ -920,13 +920,13 @@
 
 template <class _Key, class _Compare, class _Allocator>
 multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
-    : __tree_(_STD::move(__s.__tree_), __a)
+    : __tree_(_VSTD::move(__s.__tree_), __a)
 {
     if (__a != __s.get_allocator())
     {
         const_iterator __e = cend();
         while (!__s.empty())
-            insert(__e, _STD::move(__s.__tree_.remove(__s.begin())->__value_));
+            insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
     }
 }
 
@@ -938,7 +938,7 @@
 operator==(const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Compare, class _Allocator>
@@ -947,7 +947,7 @@
 operator< (const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Compare, class _Allocator>
diff --git a/include/sstream b/include/sstream
index 2a5fcc5..a2a0d31 100644
--- a/include/sstream
+++ b/include/sstream
@@ -261,7 +261,7 @@
     ptrdiff_t __nout = __rhs.pptr()  - __rhs.pbase();
     ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
     ptrdiff_t __hm   = __rhs.__hm_   - __rhs.pbase();
-    __str_ = _STD::move(__rhs.__str_);
+    __str_ = _VSTD::move(__rhs.__str_);
     char_type* __p = const_cast<char_type*>(__str_.data());
     this->setg(__p, __p + __ninp, __p + __einp);
     this->setp(__p, __p + __eout);
@@ -284,7 +284,7 @@
     ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
     ptrdiff_t __hm   = __rhs.__hm_   - __rhs.pbase();
     __mode_ = __rhs.__mode_;
-    __str_ = _STD::move(__rhs.__str_);
+    __str_ = _VSTD::move(__rhs.__str_);
     char_type* __p = const_cast<char_type*>(__str_.data());
     this->setg(__p, __p + __ninp, __p + __einp);
     this->setp(__p, __p + __eout);
@@ -314,7 +314,7 @@
     ptrdiff_t __lnout = this->pptr()  - this->pbase();
     ptrdiff_t __leout = this->epptr() - this->pbase();
     ptrdiff_t __lhm   = this->__hm_   - this->pbase();
-    _STD::swap(__mode_, __rhs.__mode_);
+    _VSTD::swap(__mode_, __rhs.__mode_);
     __str_.swap(__rhs.__str_);
     char_type* __p = const_cast<char_type*>(__str_.data());
     this->setg(__p, __p + __rninp, __p + __reinp);
@@ -451,7 +451,7 @@
             }
 #endif  // _LIBCPP_NO_EXCEPTIONS
         }
-        __hm_ = _STD::max(this->pptr() + 1, __hm_);
+        __hm_ = _VSTD::max(this->pptr() + 1, __hm_);
         if (__mode_ & ios_base::in)
         {
             char_type* __p = const_cast<char_type*>(__str_.data());
@@ -582,8 +582,8 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
-    : basic_istream<_CharT, _Traits>(_STD::move(__rhs)),
-      __sb_(_STD::move(__rhs.__sb_))
+    : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
+      __sb_(_VSTD::move(__rhs.__sb_))
 {
     basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
 }
@@ -592,8 +592,8 @@
 basic_istringstream<_CharT, _Traits, _Allocator>&
 basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&& __rhs)
 {
-    basic_istream<char_type, traits_type>::operator=(_STD::move(__rhs));
-    __sb_ = _STD::move(__rhs.__sb_);
+    basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+    __sb_ = _VSTD::move(__rhs.__sb_);
     return *this;
 }
 
@@ -701,8 +701,8 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
-    : basic_ostream<_CharT, _Traits>(_STD::move(__rhs)),
-      __sb_(_STD::move(__rhs.__sb_))
+    : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
+      __sb_(_VSTD::move(__rhs.__sb_))
 {
     basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
 }
@@ -711,8 +711,8 @@
 basic_ostringstream<_CharT, _Traits, _Allocator>&
 basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&& __rhs)
 {
-    basic_ostream<char_type, traits_type>::operator=(_STD::move(__rhs));
-    __sb_ = _STD::move(__rhs.__sb_);
+    basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+    __sb_ = _VSTD::move(__rhs.__sb_);
     return *this;
 }
 
@@ -820,8 +820,8 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
-    : basic_iostream<_CharT, _Traits>(_STD::move(__rhs)),
-      __sb_(_STD::move(__rhs.__sb_))
+    : basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
+      __sb_(_VSTD::move(__rhs.__sb_))
 {
     basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
 }
@@ -830,8 +830,8 @@
 basic_stringstream<_CharT, _Traits, _Allocator>&
 basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&& __rhs)
 {
-    basic_iostream<char_type, traits_type>::operator=(_STD::move(__rhs));
-    __sb_ = _STD::move(__rhs.__sb_);
+    basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+    __sb_ = _VSTD::move(__rhs.__sb_);
     return *this;
 }
 
diff --git a/include/stack b/include/stack
index 2e00700..3d72f96 100644
--- a/include/stack
+++ b/include/stack
@@ -125,7 +125,7 @@
     _LIBCPP_INLINE_VISIBILITY
     stack(stack&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
-        : c(_STD::move(__q.c)) {}
+        : c(_VSTD::move(__q.c)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
@@ -135,14 +135,14 @@
     _LIBCPP_INLINE_VISIBILITY
     stack& operator=(stack&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
-        {c = _STD::move(__q.c); return *this;}
+        {c = _VSTD::move(__q.c); return *this;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     explicit stack(const container_type& __c) : c(__c) {}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    explicit stack(container_type&& __c) : c(_STD::move(__c)) {}
+    explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
@@ -168,13 +168,13 @@
         stack(container_type&& __c, const _Alloc& __a,
               typename enable_if<uses_allocator<container_type,
                                                 _Alloc>::value>::type* = 0)
-            : c(_STD::move(__c), __a) {}
+            : c(_VSTD::move(__c), __a) {}
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         stack(stack&& __s, const _Alloc& __a,
               typename enable_if<uses_allocator<container_type,
                                                 _Alloc>::value>::type* = 0)
-            : c(_STD::move(__s.c), __a) {}
+            : c(_VSTD::move(__s.c), __a) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
@@ -190,12 +190,12 @@
     void push(const value_type& __v) {c.push_back(__v);}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    void push(value_type&& __v) {c.push_back(_STD::move(__v));}
+    void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
 #ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         void emplace(_Args&&... __args)
-        {c.emplace_back(_STD::forward<_Args>(__args)...);}
+        {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
 #endif  // _LIBCPP_HAS_NO_VARIADICS
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
@@ -205,7 +205,7 @@
     void swap(stack& __s)
         _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
     {
-        using _STD::swap;
+        using _VSTD::swap;
         swap(c, __s.c);
     }
 
diff --git a/include/streambuf b/include/streambuf
index 1d41fc9..feb62c7 100644
--- a/include/streambuf
+++ b/include/streambuf
@@ -399,13 +399,13 @@
 void
 basic_streambuf<_CharT, _Traits>::swap(basic_streambuf& __sb)
 {
-    _STD::swap(__loc_, __sb.__loc_);
-    _STD::swap(__binp_, __sb.__binp_);
-    _STD::swap(__ninp_, __sb.__ninp_);
-    _STD::swap(__einp_, __sb.__einp_);
-    _STD::swap(__bout_, __sb.__bout_);
-    _STD::swap(__nout_, __sb.__nout_);
-    _STD::swap(__eout_, __sb.__eout_);
+    _VSTD::swap(__loc_, __sb.__loc_);
+    _VSTD::swap(__binp_, __sb.__binp_);
+    _VSTD::swap(__ninp_, __sb.__ninp_);
+    _VSTD::swap(__einp_, __sb.__einp_);
+    _VSTD::swap(__bout_, __sb.__bout_);
+    _VSTD::swap(__nout_, __sb.__nout_);
+    _VSTD::swap(__eout_, __sb.__eout_);
 }
 
 template <class _CharT, class _Traits>
diff --git a/include/string b/include/string
index 249af09..5996c32 100644
--- a/include/string
+++ b/include/string
@@ -1052,8 +1052,8 @@
     typedef __wrap_iter<pointer>                         iterator;
     typedef __wrap_iter<const_pointer>                   const_iterator;
 #endif  // defined(_LIBCPP_RAW_ITERATORS)
-    typedef _STD::reverse_iterator<iterator>             reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator>       const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>             reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator>       const_reverse_iterator;
 
 private:
     struct __long
@@ -1279,7 +1279,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_string& assign(basic_string&& str)
-        {*this = _STD::move(str); return *this;}
+        {*this = _VSTD::move(str); return *this;}
 #endif
     basic_string& assign(const basic_string& __str, size_type __pos, size_type __n);
     basic_string& assign(const_pointer __s, size_type __n);
@@ -1588,7 +1588,7 @@
     static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
         _NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
     _LIBCPP_INLINE_VISIBILITY
@@ -1790,7 +1790,7 @@
 _LIBCPP_INLINE_VISIBILITY inline
 basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-    : __r_(_STD::move(__str.__r_))
+    : __r_(_VSTD::move(__str.__r_))
 {
     __str.__zero();
 #ifdef _LIBCPP_DEBUG
@@ -1862,7 +1862,7 @@
     size_type __str_sz = __str.size();
     if (__pos > __str_sz)
         this->__throw_out_of_range();
-    __init(__str.data() + __pos, _STD::min(__n, __str_sz - __pos));
+    __init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos));
 }
 
 template <class _CharT, class _Traits, class _Allocator>
@@ -1902,7 +1902,7 @@
 >::type
 basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last)
 {
-    size_type __sz = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __sz = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__sz > max_size())
         this->__throw_length_error();
     pointer __p;
@@ -1976,7 +1976,7 @@
         this->__throw_length_error();
     pointer __old_p = __get_pointer();
     size_type __cap = __old_cap < __ms / 2 - __alignment ?
-                          __recommend(_STD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
+                          __recommend(_VSTD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
                           __ms - 1;
     pointer __p = __alloc_traits::allocate(__alloc(), __cap+1);
     __invalidate_all_iterators();
@@ -2006,7 +2006,7 @@
         this->__throw_length_error();
     pointer __old_p = __get_pointer();
     size_type __cap = __old_cap < __ms / 2 - __alignment ?
-                          __recommend(_STD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
+                          __recommend(_VSTD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
                           __ms - 1;
     pointer __p = __alloc_traits::allocate(__alloc(), __cap+1);
     __invalidate_all_iterators();
@@ -2120,7 +2120,7 @@
 {
     clear();
     shrink_to_fit();
-    __r_ = _STD::move(__str.__r_);
+    __r_ = _VSTD::move(__str.__r_);
     __str.__zero();
 }
 
@@ -2162,7 +2162,7 @@
 >::type
 basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
 {
-    size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     size_type __cap = capacity();
     if (__cap < __n)
     {
@@ -2194,7 +2194,7 @@
     size_type __sz = __str.size();
     if (__pos > __sz)
         this->__throw_out_of_range();
-    return assign(__str.data() + __pos, _STD::min(__n, __sz - __pos));
+    return assign(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));
 }
 
 template <class _CharT, class _Traits, class _Allocator>
@@ -2293,7 +2293,7 @@
 {
     size_type __sz = size();
     size_type __cap = capacity();
-    size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n)
     {
         if (__cap - __sz < __n)
@@ -2322,7 +2322,7 @@
     size_type __sz = __str.size();
     if (__pos > __sz)
         this->__throw_out_of_range();
-    return append(__str.data() + __pos, _STD::min(__n, __sz - __pos));
+    return append(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));
 }
 
 template <class _CharT, class _Traits, class _Allocator>
@@ -2417,7 +2417,7 @@
     for (; __first != __last; ++__first)
         push_back(*__first);
     pointer __p = __get_pointer();
-    _STD::rotate(__p + __ip, __p + __old_sz, __p + size());
+    _VSTD::rotate(__p + __ip, __p + __old_sz, __p + size());
     return iterator(__p + __ip);
 }
 
@@ -2433,7 +2433,7 @@
     size_type __ip = static_cast<size_type>(__pos - begin());
     size_type __sz = size();
     size_type __cap = capacity();
-    size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n)
     {
         pointer __p;
@@ -2474,7 +2474,7 @@
     size_type __str_sz = __str.size();
     if (__pos2 > __str_sz)
         this->__throw_out_of_range();
-    return insert(__pos1, __str.data() + __pos2, _STD::min(__n, __str_sz - __pos2));
+    return insert(__pos1, __str.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2));
 }
 
 template <class _CharT, class _Traits, class _Allocator>
@@ -2535,7 +2535,7 @@
     size_type __sz = size();
     if (__pos > __sz)
         this->__throw_out_of_range();
-    __n1 = _STD::min(__n1, __sz - __pos);
+    __n1 = _VSTD::min(__n1, __sz - __pos);
     size_type __cap = capacity();
     if (__cap - __sz + __n1 >= __n2)
     {
@@ -2586,7 +2586,7 @@
     size_type __sz = size();
     if (__pos > __sz)
         this->__throw_out_of_range();
-    __n1 = _STD::min(__n1, __sz - __pos);
+    __n1 = _VSTD::min(__n1, __sz - __pos);
     size_type __cap = capacity();
     pointer __p;
     if (__cap - __sz + __n1 >= __n2)
@@ -2656,7 +2656,7 @@
     size_type __str_sz = __str.size();
     if (__pos2 > __str_sz)
         this->__throw_out_of_range();
-    return replace(__pos1, __n1, __str.data() + __pos2, _STD::min(__n2, __str_sz - __pos2));
+    return replace(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2));
 }
 
 template <class _CharT, class _Traits, class _Allocator>
@@ -2714,7 +2714,7 @@
     if (__n)
     {
         pointer __p = __get_pointer();
-        __n = _STD::min(__n, __sz - __pos);
+        __n = _VSTD::min(__n, __sz - __pos);
         size_type __n_move = __sz - __pos - __n;
         if (__n_move != 0)
             traits_type::move(__p + __pos, __p + __pos + __n, __n_move);
@@ -2840,7 +2840,7 @@
         this->__throw_length_error();
     size_type __cap = capacity();
     size_type __sz = size();
-    __res_arg = _STD::max(__res_arg, __sz);
+    __res_arg = _VSTD::max(__res_arg, __sz);
     __res_arg = __recommend(__res_arg);
     if (__res_arg != __cap)
     {
@@ -2985,7 +2985,7 @@
     size_type __sz = size();
     if (__pos > __sz)
         this->__throw_out_of_range();
-    size_type __rlen = _STD::min(__n, __sz - __pos);
+    size_type __rlen = _VSTD::min(__n, __sz - __pos);
     traits_type::copy(__s, data() + __pos, __rlen);
     return __rlen;
 }
@@ -3005,7 +3005,7 @@
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                    __is_nothrow_swappable<allocator_type>::value)
 {
-    _STD::swap(__r_.first(), __str.__r_.first());
+    _VSTD::swap(__r_.first(), __str.__r_.first());
     __swap_alloc(__alloc(), __str.__alloc());
 #ifdef _LIBCPP_DEBUG
     __invalidate_all_iterators();
@@ -3039,7 +3039,7 @@
     if (__n == 0)
         return __pos;
     const_pointer __p = data();
-    const_pointer __r = _STD::search(__p + __pos, __p + __sz, __s, __s + __n,
+    const_pointer __r = _VSTD::search(__p + __pos, __p + __sz, __s, __s + __n,
                                      __traits_eq<traits_type>());
     if (__r == __p + __sz)
         return npos;
@@ -3094,13 +3094,13 @@
     assert(__s != 0);
 #endif
     size_type __sz = size();
-    __pos = _STD::min(__pos, __sz);
+    __pos = _VSTD::min(__pos, __sz);
     if (__n < __sz - __pos)
         __pos += __n;
     else
         __pos = __sz;
     const_pointer __p = data();
-    const_pointer __r = _STD::find_end(__p, __p + __pos, __s, __s + __n,
+    const_pointer __r = _VSTD::find_end(__p, __p + __pos, __s, __s + __n,
                                        __traits_eq<traits_type>());
     if (__n > 0 && __r == __p + __pos)
         return npos;
@@ -3165,7 +3165,7 @@
     if (__pos >= __sz || __n == 0)
         return npos;
     const_pointer __p = data();
-    const_pointer __r = _STD::find_first_of(__p + __pos, __p + __sz, __s,
+    const_pointer __r = _VSTD::find_first_of(__p + __pos, __p + __sz, __s,
                                             __s + __n, __traits_eq<traits_type>());
     if (__r == __p + __sz)
         return npos;
@@ -3416,7 +3416,7 @@
     size_type __sz = __str.size();
     if (__pos2 > __sz)
         this->__throw_out_of_range();
-    return compare(__pos1, __n1, __str.data() + __pos2, _STD::min(__n2,
+    return compare(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2,
                                                                   __sz - __pos2));
 }
 
@@ -3455,8 +3455,8 @@
     size_type __sz = size();
     if (__pos1 > __sz || __n2 == npos)
         this->__throw_out_of_range();
-    size_type __rlen = _STD::min(__n1, __sz - __pos1);
-    int __r = traits_type::compare(data() + __pos1, __s, _STD::min(__rlen, __n2));
+    size_type __rlen = _VSTD::min(__n1, __sz - __pos1);
+    int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2));
     if (__r == 0)
     {
         if (__rlen < __n2)
@@ -3819,7 +3819,7 @@
 basic_string<_CharT, _Traits, _Allocator>
 operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs)
 {
-    return _STD::move(__lhs.append(__rhs));
+    return _VSTD::move(__lhs.append(__rhs));
 }
 
 template<class _CharT, class _Traits, class _Allocator>
@@ -3827,7 +3827,7 @@
 basic_string<_CharT, _Traits, _Allocator>
 operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs)
 {
-    return _STD::move(__rhs.insert(0, __lhs));
+    return _VSTD::move(__rhs.insert(0, __lhs));
 }
 
 template<class _CharT, class _Traits, class _Allocator>
@@ -3835,7 +3835,7 @@
 basic_string<_CharT, _Traits, _Allocator>
 operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs)
 {
-    return _STD::move(__lhs.append(__rhs));
+    return _VSTD::move(__lhs.append(__rhs));
 }
 
 template<class _CharT, class _Traits, class _Allocator>
@@ -3843,7 +3843,7 @@
 basic_string<_CharT, _Traits, _Allocator>
 operator+(const _CharT* __lhs , basic_string<_CharT,_Traits,_Allocator>&& __rhs)
 {
-    return _STD::move(__rhs.insert(0, __lhs));
+    return _VSTD::move(__rhs.insert(0, __lhs));
 }
 
 template<class _CharT, class _Traits, class _Allocator>
@@ -3852,7 +3852,7 @@
 operator+(_CharT __lhs, basic_string<_CharT,_Traits,_Allocator>&& __rhs)
 {
     __rhs.insert(__rhs.begin(), __lhs);
-    return _STD::move(__rhs);
+    return _VSTD::move(__rhs);
 }
 
 template<class _CharT, class _Traits, class _Allocator>
@@ -3860,7 +3860,7 @@
 basic_string<_CharT, _Traits, _Allocator>
 operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const _CharT* __rhs)
 {
-    return _STD::move(__lhs.append(__rhs));
+    return _VSTD::move(__lhs.append(__rhs));
 }
 
 template<class _CharT, class _Traits, class _Allocator>
@@ -3869,7 +3869,7 @@
 operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, _CharT __rhs)
 {
     __lhs.push_back(__rhs);
-    return _STD::move(__lhs);
+    return _VSTD::move(__lhs);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/strstream b/include/strstream
index 6e60365..8f4ed0c 100644
--- a/include/strstream
+++ b/include/strstream
@@ -207,8 +207,8 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     istrstream(istrstream&& __rhs)
-        : istream(_STD::move(__rhs)),
-          __sb_(_STD::move(__rhs.__sb_))
+        : istream(_VSTD::move(__rhs)),
+          __sb_(_VSTD::move(__rhs.__sb_))
     {
         istream::set_rdbuf(&__sb_);
     }
@@ -216,8 +216,8 @@
     _LIBCPP_INLINE_VISIBILITY
     istrstream& operator=(istrstream&& __rhs)
     {
-        istream::operator=(_STD::move(__rhs));
-        __sb_ = _STD::move(__rhs.__sb_);
+        istream::operator=(_VSTD::move(__rhs));
+        __sb_ = _VSTD::move(__rhs.__sb_);
         return *this;
     }
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -256,8 +256,8 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     ostrstream(ostrstream&& __rhs)
-        : ostream(_STD::move(__rhs)),
-          __sb_(_STD::move(__rhs.__sb_))
+        : ostream(_VSTD::move(__rhs)),
+          __sb_(_VSTD::move(__rhs.__sb_))
     {
         ostream::set_rdbuf(&__sb_);
     }
@@ -265,8 +265,8 @@
     _LIBCPP_INLINE_VISIBILITY
     ostrstream& operator=(ostrstream&& __rhs)
     {
-        ostream::operator=(_STD::move(__rhs));
-        __sb_ = _STD::move(__rhs.__sb_);
+        ostream::operator=(_VSTD::move(__rhs));
+        __sb_ = _VSTD::move(__rhs.__sb_);
         return *this;
     }
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -316,8 +316,8 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     strstream(strstream&& __rhs)
-        : iostream(_STD::move(__rhs)),
-          __sb_(_STD::move(__rhs.__sb_))
+        : iostream(_VSTD::move(__rhs)),
+          __sb_(_VSTD::move(__rhs.__sb_))
     {
         iostream::set_rdbuf(&__sb_);
     }
@@ -325,8 +325,8 @@
     _LIBCPP_INLINE_VISIBILITY
     strstream& operator=(strstream&& __rhs)
     {
-        iostream::operator=(_STD::move(__rhs));
-        __sb_ = _STD::move(__rhs.__sb_);
+        iostream::operator=(_VSTD::move(__rhs));
+        __sb_ = _VSTD::move(__rhs.__sb_);
         return *this;
     }
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/thread b/include/thread
index a04572f..ce3ca49 100644
--- a/include/thread
+++ b/include/thread
@@ -284,7 +284,7 @@
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(thread& __t) {_STD::swap(__t_, __t.__t_);}
+    void swap(thread& __t) {_VSTD::swap(__t_, __t.__t_);}
 
     _LIBCPP_INLINE_VISIBILITY
     bool joinable() const {return __t_ != 0;}
@@ -325,7 +325,7 @@
 void
 __threaad_execute(tuple<_F, _Args...>& __t, __tuple_indices<_Indices...>)
 {
-    __invoke(_STD::move(_STD::get<0>(__t)), _STD::move(_STD::get<_Indices>(__t))...);
+    __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
 }
 
 template <class _F>
@@ -345,8 +345,8 @@
 thread::thread(_F&& __f, _Args&&... __args)
 {
     typedef tuple<typename decay<_F>::type, typename decay<_Args>::type...> _G;
-    _STD::unique_ptr<_G> __p(new _G(__decay_copy(_STD::forward<_F>(__f)),
-                                __decay_copy(_STD::forward<_Args>(__args))...));
+    _VSTD::unique_ptr<_G> __p(new _G(__decay_copy(_VSTD::forward<_F>(__f)),
+                                __decay_copy(_VSTD::forward<_Args>(__args))...));
     int __ec = pthread_create(&__t_, 0, &__thread_proxy<_G>, __p.get());
     if (__ec == 0)
         __p.release();
diff --git a/include/tuple b/include/tuple
index c075e42..66a0c91 100644
--- a/include/tuple
+++ b/include/tuple
@@ -191,7 +191,7 @@
               class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(_Tp&& __t)
-            : value(_STD::forward<_Tp>(__t))
+            : value(_VSTD::forward<_Tp>(__t))
         {static_assert(!is_reference<_Hp>::value ||
                         is_lvalue_reference<_Hp>::value &&
                         (is_lvalue_reference<_Tp>::value ||
@@ -207,7 +207,7 @@
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
-            : value(_STD::forward<_Tp>(__t))
+            : value(_VSTD::forward<_Tp>(__t))
         {static_assert(!is_lvalue_reference<_Hp>::value ||
                         is_lvalue_reference<_Hp>::value &&
                         (is_lvalue_reference<_Tp>::value ||
@@ -221,7 +221,7 @@
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
-            : value(allocator_arg_t(), __a, _STD::forward<_Tp>(__t))
+            : value(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
         {static_assert(!is_lvalue_reference<_Hp>::value ||
                         is_lvalue_reference<_Hp>::value &&
                         (is_lvalue_reference<_Tp>::value ||
@@ -235,7 +235,7 @@
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
-            : value(_STD::forward<_Tp>(__t), __a)
+            : value(_VSTD::forward<_Tp>(__t), __a)
         {static_assert(!is_lvalue_reference<_Hp>::value ||
                         is_lvalue_reference<_Hp>::value &&
                         (is_lvalue_reference<_Tp>::value ||
@@ -260,14 +260,14 @@
         __tuple_leaf&
         operator=(_Tp&& __t)
         {
-            value = _STD::forward<_Tp>(__t);
+            value = _VSTD::forward<_Tp>(__t);
             return *this;
         }
 
     _LIBCPP_INLINE_VISIBILITY
     int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
     {
-        _STD::swap(*this, __t);
+        _VSTD::swap(*this, __t);
         return 0;
     }
 
@@ -302,22 +302,22 @@
               class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(_Tp&& __t)
-            : _Hp(_STD::forward<_Tp>(__t)) {}
+            : _Hp(_VSTD::forward<_Tp>(__t)) {}
 
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
-            : _Hp(_STD::forward<_Tp>(__t)) {}
+            : _Hp(_VSTD::forward<_Tp>(__t)) {}
 
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
-            : _Hp(allocator_arg_t(), __a, _STD::forward<_Tp>(__t)) {}
+            : _Hp(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t)) {}
 
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
-            : _Hp(_STD::forward<_Tp>(__t), __a) {}
+            : _Hp(_VSTD::forward<_Tp>(__t), __a) {}
 
     template <class _Tp>
         _LIBCPP_INLINE_VISIBILITY
@@ -329,7 +329,7 @@
         __tuple_leaf&
         operator=(_Tp&& __t)
         {
-            _Hp::operator=(_STD::forward<_Tp>(__t));
+            _Hp::operator=(_VSTD::forward<_Tp>(__t));
             return *this;
         }
 
@@ -337,7 +337,7 @@
     int
     swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
     {
-        _STD::swap(*this, __t);
+        _VSTD::swap(*this, __t);
         return 0;
     }
 
@@ -378,7 +378,7 @@
         __tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
                      __tuple_indices<_Ul...>, __tuple_types<_Tl...>,
                      _Up&&... __u) :
-            __tuple_leaf<_Uf, _Tf>(_STD::forward<_Up>(__u))...,
+            __tuple_leaf<_Uf, _Tf>(_VSTD::forward<_Up>(__u))...,
             __tuple_leaf<_Ul, _Tl>()...
             {}
 
@@ -391,7 +391,7 @@
                      __tuple_indices<_Ul...>, __tuple_types<_Tl...>,
                      _Up&&... __u) :
             __tuple_leaf<_Uf, _Tf>(__uses_alloc_ctor<_Tf, _Alloc, _Up>(), __a,
-            _STD::forward<_Up>(__u))...,
+            _VSTD::forward<_Up>(__u))...,
             __tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)...
             {}
 
@@ -403,8 +403,8 @@
              >
         _LIBCPP_INLINE_VISIBILITY
         __tuple_impl(_Tuple&& __t)
-            : __tuple_leaf<_Indx, _Tp>(_STD::forward<typename tuple_element<_Indx,
-                                       typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
+            : __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
+                                       typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
             {}
 
     template <class _Alloc, class _Tuple,
@@ -417,8 +417,8 @@
         __tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
             : __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx,
                                        typename __make_tuple_types<_Tuple>::type>::type>(), __a,
-                                       _STD::forward<typename tuple_element<_Indx,
-                                       typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
+                                       _VSTD::forward<typename tuple_element<_Indx,
+                                       typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
             {}
 
     template <class _Tuple>
@@ -430,8 +430,8 @@
         >::type
         operator=(_Tuple&& __t)
         {
-            __swallow(__tuple_leaf<_Indx, _Tp>::operator=(_STD::forward<typename tuple_element<_Indx,
-                                       typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...);
+            __swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<typename tuple_element<_Indx,
+                                       typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...);
             return *this;
         }
 
@@ -499,7 +499,7 @@
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
-                    _STD::forward<_Up>(__u)...) {}
+                    _VSTD::forward<_Up>(__u)...) {}
 
     template <class _Alloc, class ..._Up,
               class = typename enable_if
@@ -522,7 +522,7 @@
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
-                    _STD::forward<_Up>(__u)...) {}
+                    _VSTD::forward<_Up>(__u)...) {}
 
     template <class _Tuple,
               class = typename enable_if
@@ -532,7 +532,7 @@
              >
         _LIBCPP_INLINE_VISIBILITY
         tuple(_Tuple&& __t)
-            : base_(_STD::forward<_Tuple>(__t)) {}
+            : base_(_VSTD::forward<_Tuple>(__t)) {}
 
     template <class _Alloc, class _Tuple,
               class = typename enable_if
@@ -542,7 +542,7 @@
              >
         _LIBCPP_INLINE_VISIBILITY
         tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
-            : base_(allocator_arg_t(), __a, _STD::forward<_Tuple>(__t)) {}
+            : base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
 
     template <class _Tuple,
               class = typename enable_if
@@ -554,7 +554,7 @@
         tuple&
         operator=(_Tuple&& __t)
         {
-            base_.operator=(_STD::forward<_Tuple>(__t));
+            base_.operator=(_VSTD::forward<_Tuple>(__t));
             return *this;
         }
 
@@ -676,7 +676,7 @@
 tuple<typename __make_tuple_return<_Tp>::type...>
 make_tuple(_Tp&&... __t)
 {
-    return tuple<typename __make_tuple_return<_Tp>::type...>(_STD::forward<_Tp>(__t)...);
+    return tuple<typename __make_tuple_return<_Tp>::type...>(_VSTD::forward<_Tp>(__t)...);
 }
 
 template <class... _Tp>
@@ -684,7 +684,7 @@
 tuple<_Tp&&...>
 forward_as_tuple(_Tp&&... __t)
 {
-    return tuple<_Tp&&...>(_STD::forward<_Tp>(__t)...);
+    return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
 }
 
 template <size_t _I>
@@ -882,8 +882,8 @@
     typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type
     operator()(tuple<_Types...> __t, _Tuple0&& __t0)
     {
-        return _STD::forward_as_tuple(_STD::forward<_Types>(get<_I0>(__t))...,
-                                      get<_J0>(_STD::forward<_Tuple0>(__t0))...);
+        return _VSTD::forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
+                                      get<_J0>(_VSTD::forward<_Tuple0>(__t0))...);
     }
 
     template <class _Tuple0, class _Tuple1, class ..._Tuples>
@@ -897,12 +897,12 @@
            tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>,
            typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type,
            typename __make_tuple_indices<tuple_size<_T1>::value>::type>()
-                           (_STD::forward_as_tuple(
-                              _STD::forward<_Types>(get<_I0>(__t))...,
-                              get<_J0>(_STD::forward<_Tuple0>(__t0))...
+                           (_VSTD::forward_as_tuple(
+                              _VSTD::forward<_Types>(get<_I0>(__t))...,
+                              get<_J0>(_VSTD::forward<_Tuple0>(__t0))...
                             ),
-                            _STD::forward<_Tuple1>(__t1),
-                            _STD::forward<_Tuples>(__tpls)...);
+                            _VSTD::forward<_Tuple1>(__t1),
+                            _VSTD::forward<_Tuples>(__tpls)...);
     }
 };
 
@@ -914,8 +914,8 @@
     typedef typename remove_reference<_Tuple0>::type _T0;
     return __tuple_cat<tuple<>, __tuple_indices<>,
                   typename __make_tuple_indices<tuple_size<_T0>::value>::type>()
-                  (tuple<>(), _STD::forward<_Tuple0>(__t0),
-                                            _STD::forward<_Tuples>(__tpls)...);
+                  (tuple<>(), _VSTD::forward<_Tuple0>(__t0),
+                                            _VSTD::forward<_Tuples>(__tpls)...);
 }
 
 template <class ..._Tp, class _Alloc>
@@ -928,8 +928,8 @@
 pair<_T1, _T2>::pair(piecewise_construct_t,
                      tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
                      __tuple_indices<_I1...>, __tuple_indices<_I2...>)
-    :  first(_STD::forward<_Args1>(get<_I1>( __first_args))...),
-      second(_STD::forward<_Args2>(get<_I2>(__second_args))...)
+    :  first(_VSTD::forward<_Args1>(get<_I1>( __first_args))...),
+      second(_VSTD::forward<_Args2>(get<_I2>(__second_args))...)
 {
 }
 
diff --git a/include/type_traits b/include/type_traits
index 672ec15..120c270 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -1208,7 +1208,7 @@
 // is_assignable
 
 template <class _Tp, class _Arg>
-decltype((_STD::declval<_Tp>() = _STD::declval<_Arg>(), true_type()))
+decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>(), true_type()))
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 __is_assignable_test(_Tp&&, _Arg&&);
 #else
@@ -1265,7 +1265,7 @@
 };
 
 template <class _Tp>
-decltype((_STD::declval<__destructible_test<_Tp> >().~__destructible_test<_Tp>(), true_type()))
+decltype((_VSTD::declval<__destructible_test<_Tp> >().~__destructible_test<_Tp>(), true_type()))
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 __is_destructible_test(_Tp&&);
 #else
@@ -1435,7 +1435,7 @@
 typename decay<_Tp>::type
 __decay_copy(_Tp&& __t)
 {
-    return _STD::forward<_Tp>(__t);
+    return _VSTD::forward<_Tp>(__t);
 }
 
 #else
@@ -1445,7 +1445,7 @@
 typename decay<_Tp>::type
 __decay_copy(const _Tp& __t)
 {
-    return _STD::forward<_Tp>(__t);
+    return _VSTD::forward<_Tp>(__t);
 }
 
 #endif
@@ -1715,7 +1715,7 @@
 template <class _R, class _Class, class _Tp>
 struct __result_of_mdp<_R _Class::*, _Tp, false>
 {
-    typedef typename __apply_cv<decltype(*_STD::declval<_Tp>()), _R>::type&& type;
+    typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _R>::type&& type;
 };
 
 template <class _R, class _Class, class _Tp>
@@ -1800,7 +1800,7 @@
 template <class _R, class _Class, class _Tp>
 struct __result_of_mdp<_R _Class::*, _Tp, false>
 {
-    typedef typename __apply_cv<decltype(*_STD::declval<_Tp>()), _R>::type& type;
+    typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _R>::type& type;
 };
 
 template <class _R, class _Class, class _Tp>
@@ -1901,7 +1901,7 @@
 //      main is_constructible test
 
 template <class _Tp, class ..._Args>
-decltype(_STD::move(_Tp(_STD::declval<_Args>()...)), true_type())
+decltype(_VSTD::move(_Tp(_VSTD::declval<_Args>()...)), true_type())
 __is_constructible_test(_Tp&&, _Args&& ...);
 
 template <class ..._Args>
@@ -2028,7 +2028,7 @@
 __is_constructible0_test(__any);
 
 template <class _Tp, class _A0>
-decltype((_Tp(_STD::declval<_A0>()), true_type()))
+decltype((_Tp(_VSTD::declval<_A0>()), true_type()))
 __is_constructible1_test(_Tp&, _A0&);
 
 template <class _A0>
@@ -2036,7 +2036,7 @@
 __is_constructible1_test(__any, _A0&);
 
 template <class _Tp, class _A0, class _A1>
-decltype((_Tp(_STD::declval<_A0>(), _STD::declval<_A1>()), true_type()))
+decltype((_Tp(_VSTD::declval<_A0>(), _VSTD::declval<_A1>()), true_type()))
 __is_constructible2_test(_Tp&, _A0&, _A1&);
 
 template <class _A0, class _A1>
@@ -2608,7 +2608,7 @@
 
 template <class _Tp, class _Arg>
 struct __is_nothrow_assignable<true, _Tp, _Arg>
-    : public integral_constant<bool, noexcept(_STD::declval<_Tp>() = _STD::declval<_Arg>()) >
+    : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>()) >
 {
 };
 
@@ -2694,7 +2694,7 @@
 
 template <class _Tp>
 struct __is_nothrow_destructible<true, _Tp>
-    : public integral_constant<bool, noexcept(_STD::declval<_Tp>().~_Tp()) >
+    : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>().~_Tp()) >
 {
 };
 
@@ -2946,31 +2946,31 @@
 template <class _F, class _A0, class ..._Args>
 auto
 __invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
-    -> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...));
+    -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
 
 template <class _F, class _A0, class ..._Args>
 auto
 __invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
-    -> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...));
+    -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
 
 // bullets 3 and 4
 
 template <class _F, class _A0>
 auto
 __invoke(_F&& __f, _A0&& __a0)
-    -> decltype(_STD::forward<_A0>(__a0).*__f);
+    -> decltype(_VSTD::forward<_A0>(__a0).*__f);
 
 template <class _F, class _A0>
 auto
 __invoke(_F&& __f, _A0&& __a0)
-    -> decltype((*_STD::forward<_A0>(__a0)).*__f);
+    -> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
 
 // bullet 5
 
 template <class _F, class ..._Args>
 auto
 __invoke(_F&& __f, _Args&& ...__args)
-    -> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...));
+    -> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...));
 
 // __invokable
 
@@ -2979,7 +2979,7 @@
     : private __check_complete<_F, _Args...>
 {
     typedef decltype(
-            __invoke(_STD::declval<_F>(), _STD::declval<_Args>()...)
+            __invoke(_VSTD::declval<_F>(), _VSTD::declval<_Args>()...)
                     ) type;
     static const bool value = !is_same<type, __nat>::value;
 };
@@ -3022,9 +3022,9 @@
 swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
                                     is_nothrow_move_assignable<_Tp>::value)
 {
-    _Tp __t(_STD::move(__x));
-    __x = _STD::move(__y);
-    __y = _STD::move(__t);
+    _Tp __t(_VSTD::move(__x));
+    __x = _VSTD::move(__y);
+    __y = _VSTD::move(__t);
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2>
@@ -3032,8 +3032,8 @@
 void
 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
     //                                  _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
-               _NOEXCEPT_(_NOEXCEPT_(swap(*_STD::declval<_ForwardIterator1>(),
-                                          *_STD::declval<_ForwardIterator2>())))
+               _NOEXCEPT_(_NOEXCEPT_(swap(*_VSTD::declval<_ForwardIterator1>(),
+                                          *_VSTD::declval<_ForwardIterator2>())))
 {
     swap(*__a, *__b);
 }
@@ -3043,13 +3043,13 @@
 namespace __detail
 {
 
-using _STD::swap;
+using _VSTD::swap;
 __nat swap(__any, __any);
 
 template <class _Tp>
 struct __swappable
 {
-    typedef decltype(swap(_STD::declval<_Tp&>(), _STD::declval<_Tp&>())) type;
+    typedef decltype(swap(_VSTD::declval<_Tp&>(), _VSTD::declval<_Tp&>())) type;
     static const bool value = !is_same<type, __nat>::value;
 };
 
@@ -3065,8 +3065,8 @@
 
 template <bool, class _Tp>
 struct __is_nothrow_swappable_imp
-    : public integral_constant<bool, noexcept(swap(_STD::declval<_Tp&>(),
-                                                   _STD::declval<_Tp&>()))>
+    : public integral_constant<bool, noexcept(swap(_VSTD::declval<_Tp&>(),
+                                                   _VSTD::declval<_Tp&>()))>
 {
 };
 
diff --git a/include/unordered_map b/include/unordered_map
index a75ff18..394be32 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -481,9 +481,9 @@
     void operator()(pointer __p) _NOEXCEPT
     {
         if (__second_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
+            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -731,7 +731,7 @@
               class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool> emplace(_A0&& __a0)
-            {return __table_.__emplace_unique(_STD::forward<_A0>(__a0));}
+            {return __table_.__emplace_unique(_VSTD::forward<_A0>(__a0));}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -749,7 +749,7 @@
               class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator, _A0&& __a0)
-            {return __table_.__emplace_unique(_STD::forward<_A0>(__a0)).first;}
+            {return __table_.__emplace_unique(_VSTD::forward<_A0>(__a0)).first;}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -757,8 +757,8 @@
               class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator, _A0&& __a0, _Args&&... __args)
-            {return emplace(_STD::forward<_A0>(__a0),
-                            _STD::forward<_Args>(__args)...).first;}
+            {return emplace(_VSTD::forward<_A0>(__a0),
+                            _VSTD::forward<_Args>(__args)...).first;}
 #endif  // _LIBCPP_HAS_NO_VARIADICS
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
@@ -769,7 +769,7 @@
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool> insert(_P&& __x)
-            {return __table_.__insert_unique(_STD::forward<_P>(__x));}
+            {return __table_.__insert_unique(_VSTD::forward<_P>(__x));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator, const value_type& __x)
@@ -779,7 +779,7 @@
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator insert(const_iterator, _P&& __x)
-            {return insert(_STD::forward<_P>(__x)).first;}
+            {return insert(_VSTD::forward<_P>(__x)).first;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         void insert(_InputIterator __first, _InputIterator __last);
@@ -960,21 +960,21 @@
 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
         unordered_map&& __u)
     _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
-    : __table_(_STD::move(__u.__table_))
+    : __table_(_VSTD::move(__u.__table_))
 {
 }
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
         unordered_map&& __u, const allocator_type& __a)
-    : __table_(_STD::move(__u.__table_), __a)
+    : __table_(_VSTD::move(__u.__table_), __a)
 {
     if (__a != __u.get_allocator())
     {
         iterator __i = __u.begin();
         while (__u.size() != 0)
             __table_.__insert_unique(
-                _STD::move(__u.__table_.remove((__i++).__i_)->__value_)
+                _VSTD::move(__u.__table_.remove((__i++).__i_)->__value_)
                                     );
     }
 }
@@ -1016,7 +1016,7 @@
 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
     _NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
 {
-    __table_ = _STD::move(__u.__table_);
+    __table_ = _VSTD::move(__u.__table_);
     return *this;
 }
 
@@ -1045,11 +1045,11 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first),
-                             _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
+                             _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second),
-                             _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second),
+                             _VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1065,8 +1065,8 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_),
-                             _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
+                             _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -1081,8 +1081,8 @@
 pair<typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator, bool>
 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
-                                         _STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
+                                         _VSTD::forward<_Args>(__args)...);
     pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
     if (__r.second)
         __h.release();
@@ -1098,11 +1098,11 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
-    return _STD::move(__h);
+    return _VSTD::move(__h);
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1140,7 +1140,7 @@
     iterator __i = find(__k);
     if (__i != end())
         return __i->second;
-    __node_holder __h = __construct_node(_STD::move(__k));
+    __node_holder __h = __construct_node(_VSTD::move(__k));
     pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
     __h.release();
     return __r.first->second;
@@ -1335,7 +1335,7 @@
               class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace(_A0&& __a0)
-            {return __table_.__emplace_multi(_STD::forward<_A0>(__a0));}
+            {return __table_.__emplace_multi(_VSTD::forward<_A0>(__a0));}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -1353,7 +1353,7 @@
               class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _A0&& __a0)
-            {return __table_.__emplace_hint_multi(__p.__i_, _STD::forward<_A0>(__a0));}
+            {return __table_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_A0>(__a0));}
 
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
@@ -1369,7 +1369,7 @@
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator insert(_P&& __x)
-            {return __table_.__insert_multi(_STD::forward<_P>(__x));}
+            {return __table_.__insert_multi(_VSTD::forward<_P>(__x));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __x)
@@ -1379,7 +1379,7 @@
               class = typename enable_if<is_constructible<value_type, _P>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         iterator insert(const_iterator __p, _P&& __x)
-            {return __table_.__insert_multi(__p.__i_, _STD::forward<_P>(__x));}
+            {return __table_.__insert_multi(__p.__i_, _VSTD::forward<_P>(__x));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         void insert(_InputIterator __first, _InputIterator __last);
@@ -1549,14 +1549,14 @@
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
         unordered_multimap&& __u)
     _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
-    : __table_(_STD::move(__u.__table_))
+    : __table_(_VSTD::move(__u.__table_))
 {
 }
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
         unordered_multimap&& __u, const allocator_type& __a)
-    : __table_(_STD::move(__u.__table_), __a)
+    : __table_(_VSTD::move(__u.__table_), __a)
 {
     if (__a != __u.get_allocator())
     {
@@ -1564,7 +1564,7 @@
         while (__u.size() != 0)
 {
             __table_.__insert_multi(
-                _STD::move(__u.__table_.remove((__i++).__i_)->__value_)
+                _VSTD::move(__u.__table_.remove((__i++).__i_)->__value_)
                                    );
 }
     }
@@ -1607,7 +1607,7 @@
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multimap&& __u)
     _NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
 {
-    __table_ = _STD::move(__u.__table_);
+    __table_ = _VSTD::move(__u.__table_);
     return *this;
 }
 
@@ -1636,11 +1636,11 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.first),
-                             _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
+                             _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _STD::addressof(__h->__value_.second),
-                             _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second),
+                             _VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1656,8 +1656,8 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, _STD::addressof(__h->__value_),
-                             _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
+                             _VSTD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -1672,8 +1672,8 @@
 typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
-                                         _STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
+                                         _VSTD::forward<_Args>(__args)...);
     iterator __r = __table_.__node_insert_multi(__h.get());
     __h.release();
     return __r;
@@ -1687,8 +1687,8 @@
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint(
         const_iterator __p, _A0&& __a0, _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
-                                         _STD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
+                                         _VSTD::forward<_Args>(__args)...);
     iterator __r = __table_.__node_insert_multi(__p.__i_, __h.get());
     __h.release();
     return __r;
@@ -1732,9 +1732,9 @@
     {
         _EqRng __xeq = __x.equal_range(__i->first);
         _EqRng __yeq = __y.equal_range(__i->first);
-        if (_STD::distance(__xeq.first, __xeq.second) !=
-            _STD::distance(__yeq.first, __yeq.second) ||
-                  !_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
+        if (_VSTD::distance(__xeq.first, __xeq.second) !=
+            _VSTD::distance(__yeq.first, __yeq.second) ||
+                  !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
             return false;
         __i = __xeq.second;
     }
diff --git a/include/unordered_set b/include/unordered_set
index 913cd70..2798a61 100644
--- a/include/unordered_set
+++ b/include/unordered_set
@@ -408,11 +408,11 @@
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool> emplace(_Args&&... __args)
-            {return __table_.__emplace_unique(_STD::forward<_Args>(__args)...);}
+            {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator, _Args&&... __args)
-            {return __table_.__emplace_unique(_STD::forward<_Args>(__args)...).first;}
+            {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;}
 #endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator, bool> insert(const value_type& __x)
@@ -420,7 +420,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator, bool> insert(value_type&& __x)
-        {return __table_.__insert_unique(_STD::move(__x));}
+        {return __table_.__insert_unique(_VSTD::move(__x));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator, const value_type& __x)
@@ -428,7 +428,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator, value_type&& __x)
-        {return insert(_STD::move(__x)).first;}
+        {return insert(_VSTD::move(__x)).first;}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         void insert(_InputIterator __first, _InputIterator __last);
@@ -583,20 +583,20 @@
 unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
         unordered_set&& __u)
     _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
-    : __table_(_STD::move(__u.__table_))
+    : __table_(_VSTD::move(__u.__table_))
 {
 }
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
         unordered_set&& __u, const allocator_type& __a)
-    : __table_(_STD::move(__u.__table_), __a)
+    : __table_(_VSTD::move(__u.__table_), __a)
 {
     if (__a != __u.get_allocator())
     {
         iterator __i = __u.begin();
         while (__u.size() != 0)
-            __table_.__insert_unique(_STD::move(__u.__table_.remove(__i++)->__value_));
+            __table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));
     }
 }
 
@@ -637,7 +637,7 @@
 unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
     _NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
 {
-    __table_ = _STD::move(__u.__table_);
+    __table_ = _VSTD::move(__u.__table_);
     return *this;
 }
 
@@ -801,17 +801,17 @@
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace(_Args&&... __args)
-            {return __table_.__emplace_multi(_STD::forward<_Args>(__args)...);}
+            {return __table_.__emplace_multi(_VSTD::forward<_Args>(__args)...);}
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
-            {return __table_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
+            {return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
 #endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    iterator insert(value_type&& __x) {return __table_.__insert_multi(_STD::move(__x));}
+    iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
 #endif
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __x)
@@ -819,7 +819,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, value_type&& __x)
-        {return __table_.__insert_multi(__p, _STD::move(__x));}
+        {return __table_.__insert_multi(__p, _VSTD::move(__x));}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         void insert(_InputIterator __first, _InputIterator __last);
@@ -975,20 +975,20 @@
 unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
         unordered_multiset&& __u)
     _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
-    : __table_(_STD::move(__u.__table_))
+    : __table_(_VSTD::move(__u.__table_))
 {
 }
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
         unordered_multiset&& __u, const allocator_type& __a)
-    : __table_(_STD::move(__u.__table_), __a)
+    : __table_(_VSTD::move(__u.__table_), __a)
 {
     if (__a != __u.get_allocator())
     {
         iterator __i = __u.begin();
         while (__u.size() != 0)
-            __table_.__insert_multi(_STD::move(__u.__table_.remove(__i++)->__value_));
+            __table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));
     }
 }
 
@@ -1030,7 +1030,7 @@
         unordered_multiset&& __u)
     _NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
 {
-    __table_ = _STD::move(__u.__table_);
+    __table_ = _VSTD::move(__u.__table_);
     return *this;
 }
 
@@ -1081,9 +1081,9 @@
     {
         _EqRng __xeq = __x.equal_range(*__i);
         _EqRng __yeq = __y.equal_range(*__i);
-        if (_STD::distance(__xeq.first, __xeq.second) !=
-            _STD::distance(__yeq.first, __yeq.second) ||
-                  !_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
+        if (_VSTD::distance(__xeq.first, __xeq.second) !=
+            _VSTD::distance(__yeq.first, __yeq.second) ||
+                  !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
             return false;
         __i = __xeq.second;
     }
diff --git a/include/utility b/include/utility
index 6934c1e..c406859 100644
--- a/include/utility
+++ b/include/utility
@@ -183,7 +183,7 @@
 void
 swap(_Tp (&__a)[_N], _Tp (&__b)[_N]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
 {
-    _STD::swap_ranges(__a, __a + _N, __b);
+    _VSTD::swap_ranges(__a, __a + _N, __b);
 }
 
 template <class _Tp>
@@ -200,7 +200,7 @@
 #endif
 move_if_noexcept(_Tp& __x) _NOEXCEPT
 {
-    return _STD::move(__x);
+    return _VSTD::move(__x);
 }
 
 struct _LIBCPP_VISIBLE piecewise_construct_t { };
@@ -246,8 +246,8 @@
                                          is_convertible<_U2, second_type>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         pair(_U1&& __u1, _U2&& __u2)
-            : first(_STD::forward<_U1>(__u1)),
-              second(_STD::forward<_U2>(__u2))
+            : first(_VSTD::forward<_U1>(__u1)),
+              second(_VSTD::forward<_U2>(__u2))
             {}
 
     template<class _U1, class _U2>
@@ -255,16 +255,16 @@
         pair(pair<_U1, _U2>&& __p,
                  typename enable_if<is_convertible<_U1, _T1>::value &&
                                     is_convertible<_U2, _T2>::value>::type* = 0)
-            : first(_STD::forward<_U1>(__p.first)),
-              second(_STD::forward<_U2>(__p.second)) {}
+            : first(_VSTD::forward<_U1>(__p.first)),
+              second(_VSTD::forward<_U2>(__p.second)) {}
 
     _LIBCPP_INLINE_VISIBILITY
     pair&
     operator=(pair&& __p) _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
                                      is_nothrow_move_assignable<second_type>::value)
     {
-        first = _STD::forward<first_type>(__p.first);
-        second = _STD::forward<second_type>(__p.second);
+        first = _VSTD::forward<first_type>(__p.first);
+        second = _VSTD::forward<second_type>(__p.second);
         return *this;
     }
 
@@ -274,9 +274,9 @@
              class = typename enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         pair(_Tuple&& __p)
-            : first(_STD::forward<typename tuple_element<0,
+            : first(_VSTD::forward<typename tuple_element<0,
                                   typename __make_tuple_types<_Tuple>::type>::type>(get<0>(__p))),
-              second(_STD::forward<typename tuple_element<1,
+              second(_VSTD::forward<typename tuple_element<1,
                                    typename __make_tuple_types<_Tuple>::type>::type>(get<1>(__p)))
             {}
 
@@ -300,8 +300,8 @@
             typedef typename __make_tuple_types<_Tuple>::type _TupleRef;
             typedef typename tuple_element<0, _TupleRef>::type _U0;
             typedef typename tuple_element<1, _TupleRef>::type _U1;
-            first  = _STD::forward<_U0>(_STD::get<0>(__p));
-            second = _STD::forward<_U1>(_STD::get<1>(__p));
+            first  = _VSTD::forward<_U0>(_VSTD::get<0>(__p));
+            second = _VSTD::forward<_U1>(_VSTD::get<1>(__p));
             return *this;
         }
 
@@ -313,8 +313,8 @@
     swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
                                __is_nothrow_swappable<second_type>::value)
     {
-        _STD::iter_swap(&first, &__p.first);
-        _STD::iter_swap(&second, &__p.second);
+        _VSTD::iter_swap(&first, &__p.first);
+        _VSTD::iter_swap(&second, &__p.second);
     }
 private:
 
@@ -418,7 +418,7 @@
 make_pair(_T1&& __t1, _T2&& __t2)
 {
     return pair<typename __make_pair_return<_T1>::type, typename __make_pair_return<_T2>::type>
-               (_STD::forward<_T1>(__t1), _STD::forward<_T2>(__t2));
+               (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
 }
 
 #else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -494,7 +494,7 @@
     static
     _LIBCPP_INLINE_VISIBILITY
     _T1&&
-    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _STD::forward<_T1>(__p.first);}
+    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 };
@@ -520,7 +520,7 @@
     static
     _LIBCPP_INLINE_VISIBILITY
     _T2&&
-    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _STD::forward<_T2>(__p.second);}
+    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 };
@@ -548,7 +548,7 @@
 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
 get(pair<_T1, _T2>&& __p) _NOEXCEPT
 {
-    return __get_pair<_Ip>::get(_STD::move(__p));
+    return __get_pair<_Ip>::get(_VSTD::move(__p));
 }
 
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/valarray b/include/valarray
index 32e34a3..40c1fe1 100644
--- a/include/valarray
+++ b/include/valarray
@@ -2862,7 +2862,7 @@
     {
         if (size() != __v.size())
             resize(__v.size());
-        _STD::copy(__v.__begin_, __v.__end_, __begin_);
+        _VSTD::copy(__v.__begin_, __v.__end_, __begin_);
     }
     return *this;
 }
@@ -2889,7 +2889,7 @@
 {
     if (size() != __il.size())
         resize(__il.size());
-    _STD::copy(__il.begin(), __il.end(), __begin_);
+    _VSTD::copy(__il.begin(), __il.end(), __begin_);
     return *this;
 }
 
@@ -2900,7 +2900,7 @@
 valarray<_Tp>&
 valarray<_Tp>::operator=(const value_type& __x)
 {
-    _STD::fill(__begin_, __end_, __x);
+    _VSTD::fill(__begin_, __end_, __x);
     return *this;
 }
 
@@ -3415,8 +3415,8 @@
 void
 valarray<_Tp>::swap(valarray& __v)
 {
-    _STD::swap(__begin_, __v.__begin_);
-    _STD::swap(__end_, __v.__end_);
+    _VSTD::swap(__begin_, __v.__begin_);
+    _VSTD::swap(__end_, __v.__end_);
 }
 
 template <class _Tp>
@@ -3440,7 +3440,7 @@
 {
     if (__begin_ == __end_)
         return value_type();
-    return *_STD::min_element(__begin_, __end_);
+    return *_VSTD::min_element(__begin_, __end_);
 }
 
 template <class _Tp>
@@ -3450,7 +3450,7 @@
 {
     if (__begin_ == __end_)
         return value_type();
-    return *_STD::max_element(__begin_, __end_);
+    return *_VSTD::max_element(__begin_, __end_);
 }
 
 template <class _Tp>
@@ -3469,14 +3469,14 @@
         value_type* __te;
         if (__i >= 0)
         {
-            __i = _STD::min(__i, static_cast<int>(__n));
+            __i = _VSTD::min(__i, static_cast<int>(__n));
             __sb = __begin_ + __i;
             __tb = __r.__begin_;
             __te = __r.__begin_ + (__n - __i);
         }
         else
         {
-            __i = _STD::min(-__i, static_cast<int>(__n));
+            __i = _VSTD::min(-__i, static_cast<int>(__n));
             __sb = __begin_;
             __tb = __r.__begin_ + __i;
             __te = __r.__begin_ + __n;
diff --git a/include/vector b/include/vector
index e30ce78..0bd82ea 100644
--- a/include/vector
+++ b/include/vector
@@ -405,7 +405,7 @@
     void __move_assign_alloc(const __vector_base& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
-            __alloc() = _STD::move(__c.__alloc());
+            __alloc() = _VSTD::move(__c.__alloc());
         }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -417,7 +417,7 @@
     static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
     _LIBCPP_INLINE_VISIBILITY
@@ -507,8 +507,8 @@
     typedef __wrap_iter<pointer>                     iterator;
     typedef __wrap_iter<const_pointer>               const_iterator;
 #endif  // defined(_LIBCPP_RAW_ITERATORS)
-    typedef _STD::reverse_iterator<iterator>         reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator>   const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>         reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator>   const_reverse_iterator;
 
     _LIBCPP_INLINE_VISIBILITY
     vector()
@@ -642,10 +642,10 @@
 
     _LIBCPP_INLINE_VISIBILITY
     value_type*       data() _NOEXCEPT
-        {return _STD::__to_raw_pointer(this->__begin_);}
+        {return _VSTD::__to_raw_pointer(this->__begin_);}
     _LIBCPP_INLINE_VISIBILITY
     const value_type* data() const _NOEXCEPT
-        {return _STD::__to_raw_pointer(this->__begin_);}
+        {return _VSTD::__to_raw_pointer(this->__begin_);}
 
     _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -735,10 +735,10 @@
 vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v)
 {
     for (pointer __p = this->__end_; this->__begin_ < __p;)
-        __v.push_front(_STD::move_if_noexcept(*--__p));
-    _STD::swap(this->__begin_, __v.__begin_);
-    _STD::swap(this->__end_, __v.__end_);
-    _STD::swap(this->__end_cap(), __v.__end_cap());
+        __v.push_front(_VSTD::move_if_noexcept(*--__p));
+    _VSTD::swap(this->__begin_, __v.__begin_);
+    _VSTD::swap(this->__end_, __v.__end_);
+    _VSTD::swap(this->__end_cap(), __v.__end_cap());
     __v.__first_ = __v.__begin_;
     __invalidate_all_iterators();
 }
@@ -749,12 +749,12 @@
 {
     pointer __r = __v.__begin_;
     for (pointer __i = __p; this->__begin_ < __i;)
-        __v.push_front(_STD::move_if_noexcept(*--__i));
+        __v.push_front(_VSTD::move_if_noexcept(*--__i));
     for (pointer __i = __p; __i < this->__end_; ++__i)
-        __v.push_back(_STD::move_if_noexcept(*__i));
-    _STD::swap(this->__begin_, __v.__begin_);
-    _STD::swap(this->__end_, __v.__end_);
-    _STD::swap(this->__end_cap(), __v.__end_cap());
+        __v.push_back(_VSTD::move_if_noexcept(*__i));
+    _VSTD::swap(this->__begin_, __v.__begin_);
+    _VSTD::swap(this->__end_, __v.__end_);
+    _VSTD::swap(this->__end_cap(), __v.__end_cap());
     __v.__first_ = __v.__begin_;
     __invalidate_all_iterators();
     return __r;
@@ -794,7 +794,7 @@
 typename vector<_Tp, _Allocator>::size_type
 vector<_Tp, _Allocator>::max_size() const _NOEXCEPT
 {
-    return _STD::min(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2);  // end() >= begin(), always
+    return _VSTD::min(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2);  // end() >= begin(), always
 }
 
 //  Precondition:  __new_size > capacity()
@@ -809,7 +809,7 @@
     const size_type __cap = capacity();
     if (__cap >= __ms / 2)
         return __ms;
-    return _STD::max(2*__cap, __new_size);
+    return _VSTD::max(2*__cap, __new_size);
 }
 
 //  Default constructs __n objects starting at __end_
@@ -824,7 +824,7 @@
     allocator_type& __a = this->__alloc();
     do
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_));
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_));
         ++this->__end_;
         --__n;
     } while (__n > 0);
@@ -844,7 +844,7 @@
     allocator_type& __a = this->__alloc();
     do
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), __x);
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), __x);
         ++this->__end_;
         --__n;
     } while (__n > 0);
@@ -862,7 +862,7 @@
     allocator_type& __a = this->__alloc();
     for (; __first != __last; ++__first)
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
         ++this->__end_;
     }
 }
@@ -874,8 +874,8 @@
     allocator_type& __a = this->__alloc();
     for (; __first != __last; ++__first)
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_),
-                                  _STD::move(*__first));
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_),
+                                  _VSTD::move(*__first));
         ++this->__end_;
     }
 }
@@ -975,7 +975,7 @@
 vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last,
                                 typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
 {
-    size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n > 0)
     {
         allocate(__n);
@@ -989,7 +989,7 @@
                                 typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
     : __base(__a)
 {
-    size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n > 0)
     {
         allocate(__n);
@@ -1027,7 +1027,7 @@
 _LIBCPP_INLINE_VISIBILITY inline
 vector<_Tp, _Allocator>::vector(vector&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-    : __base(_STD::move(__x.__alloc()))
+    : __base(_VSTD::move(__x.__alloc()))
 {
     this->__begin_ = __x.__begin_;
     this->__end_ = __x.__end_;
@@ -1157,7 +1157,7 @@
 >::type
 vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
 {
-    typename iterator_traits<_ForwardIterator>::difference_type __new_size = _STD::distance(__first, __last);
+    typename iterator_traits<_ForwardIterator>::difference_type __new_size = _VSTD::distance(__first, __last);
     if (static_cast<size_type>(__new_size) <= capacity())
     {
         _ForwardIterator __mid = __last;
@@ -1166,9 +1166,9 @@
         {
             __growing = true;
             __mid =  __first;
-            _STD::advance(__mid, size());
+            _VSTD::advance(__mid, size());
         }
-        pointer __m = _STD::copy(__first, __mid, this->__begin_);
+        pointer __m = _VSTD::copy(__first, __mid, this->__begin_);
         if (__growing)
             __construct_at_end(__mid, __last);
         else
@@ -1189,7 +1189,7 @@
     if (__n <= capacity())
     {
         size_type __s = size();
-        _STD::fill_n(this->__begin_, _STD::min(__n, __s), __u);
+        _VSTD::fill_n(this->__begin_, _VSTD::min(__n, __s), __u);
         if (__n > __s)
             __construct_at_end(__n - __s, __u);
         else
@@ -1340,7 +1340,7 @@
     if (this->__end_ < this->__end_cap())
     {
         __alloc_traits::construct(this->__alloc(),
-                                  _STD::__to_raw_pointer(this->__end_), __x);
+                                  _VSTD::__to_raw_pointer(this->__end_), __x);
         ++this->__end_;
     }
     else
@@ -1361,15 +1361,15 @@
     if (this->__end_ < this->__end_cap())
     {
         __alloc_traits::construct(this->__alloc(),
-                                  _STD::__to_raw_pointer(this->__end_),
-                                  _STD::move(__x));
+                                  _VSTD::__to_raw_pointer(this->__end_),
+                                  _VSTD::move(__x));
         ++this->__end_;
     }
     else
     {
         allocator_type& __a = this->__alloc();
         __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
-        __v.push_back(_STD::move(__x));
+        __v.push_back(_VSTD::move(__x));
         __swap_out_circular_buffer(__v);
     }
 }
@@ -1384,15 +1384,15 @@
     if (this->__end_ < this->__end_cap())
     {
         __alloc_traits::construct(this->__alloc(),
-                                  _STD::__to_raw_pointer(this->__end_),
-                                  _STD::forward<_Args>(__args)...);
+                                  _VSTD::__to_raw_pointer(this->__end_),
+                                  _VSTD::forward<_Args>(__args)...);
         ++this->__end_;
     }
     else
     {
         allocator_type& __a = this->__alloc();
         __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
-        __v.emplace_back(_STD::forward<_Args>(__args)...);
+        __v.emplace_back(_VSTD::forward<_Args>(__args)...);
         __swap_out_circular_buffer(__v);
     }
 }
@@ -1415,7 +1415,7 @@
 {
     pointer __p = const_cast<pointer>(&*__position);
     iterator __r = __make_iter(__p);
-    this->__destruct_at_end(_STD::move(__p + 1, this->__end_, __p));
+    this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
     return __r;
 }
 
@@ -1425,7 +1425,7 @@
 {
     pointer __p = this->__begin_ + (__first - begin());
     iterator __r = __make_iter(__p);
-    this->__destruct_at_end(_STD::move(__p + (__last - __first), this->__end_, __p));
+    this->__destruct_at_end(_VSTD::move(__p + (__last - __first), this->__end_, __p));
     return __r;
 }
 
@@ -1437,9 +1437,9 @@
     difference_type __n = __old_last - __to;
     for (pointer __i = __from_s + __n; __i < __from_e; ++__i, ++this->__end_)
         __alloc_traits::construct(this->__alloc(),
-                                  _STD::__to_raw_pointer(this->__end_),
-                                  _STD::move(*__i));
-    _STD::move_backward(__from_s, __from_s + __n, __old_last);
+                                  _VSTD::__to_raw_pointer(this->__end_),
+                                  _VSTD::move(*__i));
+    _VSTD::move_backward(__from_s, __from_s + __n, __old_last);
 }
 
 template <class _Tp, class _Allocator>
@@ -1452,7 +1452,7 @@
         if (__p == this->__end_)
         {
             __alloc_traits::construct(this->__alloc(),
-                                      _STD::__to_raw_pointer(this->__end_), __x);
+                                      _VSTD::__to_raw_pointer(this->__end_), __x);
             ++this->__end_;
         }
         else
@@ -1486,21 +1486,21 @@
         if (__p == this->__end_)
         {
             __alloc_traits::construct(this->__alloc(),
-                                      _STD::__to_raw_pointer(this->__end_),
-                                      _STD::move(__x));
+                                      _VSTD::__to_raw_pointer(this->__end_),
+                                      _VSTD::move(__x));
             ++this->__end_;
         }
         else
         {
             __move_range(__p, this->__end_, __p + 1);
-            *__p = _STD::move(__x);
+            *__p = _VSTD::move(__x);
         }
     }
     else
     {
         allocator_type& __a = this->__alloc();
         __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, __a);
-        __v.push_back(_STD::move(__x));
+        __v.push_back(_VSTD::move(__x));
         __p = __swap_out_circular_buffer(__v, __p);
     }
     return __make_iter(__p);
@@ -1519,21 +1519,21 @@
         if (__p == this->__end_)
         {
             __alloc_traits::construct(this->__alloc(),
-                                      _STD::__to_raw_pointer(this->__end_),
-                                      _STD::forward<_Args>(__args)...);
+                                      _VSTD::__to_raw_pointer(this->__end_),
+                                      _VSTD::forward<_Args>(__args)...);
             ++this->__end_;
         }
         else
         {
             __move_range(__p, this->__end_, __p + 1);
-            *__p = value_type(_STD::forward<_Args>(__args)...);
+            *__p = value_type(_VSTD::forward<_Args>(__args)...);
         }
     }
     else
     {
         allocator_type& __a = this->__alloc();
         __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, __a);
-        __v.emplace_back(_STD::forward<_Args>(__args)...);
+        __v.emplace_back(_VSTD::forward<_Args>(__args)...);
         __p = __swap_out_circular_buffer(__v, __p);
     }
     return __make_iter(__p);
@@ -1565,7 +1565,7 @@
                 const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
                 if (__p <= __xr && __xr < this->__end_)
                     __xr += __old_n;
-                _STD::fill_n(__p, __n, *__xr);
+                _VSTD::fill_n(__p, __n, *__xr);
             }
         }
         else
@@ -1595,7 +1595,7 @@
     pointer __old_last = this->__end_;
     for (; this->__end_ != this->__end_cap() && __first != __last; ++__first)
     {
-        __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_),
+        __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_),
                                   *__first);
         ++this->__end_;
     }
@@ -1621,7 +1621,7 @@
         }
 #endif  // _LIBCPP_NO_EXCEPTIONS
     }
-    __p = _STD::rotate(__p, __old_last, this->__end_);
+    __p = _VSTD::rotate(__p, __old_last, this->__end_);
     insert(__make_iter(__p), move_iterator<iterator>(__v.begin()),
                                     move_iterator<iterator>(__v.end()));
     return begin() + __off;
@@ -1637,7 +1637,7 @@
 vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
 {
     pointer __p = this->__begin_ + (__position - begin());
-    difference_type __n = _STD::distance(__first, __last);
+    difference_type __n = _VSTD::distance(__first, __last);
     if (__n > 0)
     {
         if (__n <= this->__end_cap() - this->__end_)
@@ -1649,14 +1649,14 @@
             if (__n > __dx)
             {
                 __m = __first;
-                _STD::advance(__m, this->__end_ - __p);
+                _VSTD::advance(__m, this->__end_ - __p);
                 __construct_at_end(__m, __last);
                 __n = __dx;
             }
             if (__n > 0)
             {
                 __move_range(__p, __old_last, __p + __old_n);
-                _STD::copy(__first, __m, __p);
+                _VSTD::copy(__first, __m, __p);
             }
         }
         else
@@ -1698,9 +1698,9 @@
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                    __is_nothrow_swappable<allocator_type>::value)
 {
-    _STD::swap(this->__begin_, __x.__begin_);
-    _STD::swap(this->__end_, __x.__end_);
-    _STD::swap(this->__end_cap(), __x.__end_cap());
+    _VSTD::swap(this->__begin_, __x.__begin_);
+    _VSTD::swap(this->__end_, __x.__end_);
+    _VSTD::swap(this->__end_cap(), __x.__end_cap());
     __base::__swap_alloc(this->__alloc(), __x.__alloc());
 #ifdef _LIBCPP_DEBUG
     iterator::swap(this, &__x);
@@ -1778,8 +1778,8 @@
     typedef pointer                                  iterator;
     typedef const_pointer                            const_iterator;
 #endif  // _LIBCPP_DEBUG
-    typedef _STD::reverse_iterator<iterator>         reverse_iterator;
-    typedef _STD::reverse_iterator<const_iterator>   const_reverse_iterator;
+    typedef _VSTD::reverse_iterator<iterator>         reverse_iterator;
+    typedef _VSTD::reverse_iterator<const_iterator>   const_reverse_iterator;
 
 private:
     typedef size_type __storage_type;
@@ -2063,7 +2063,7 @@
     void __move_assign_alloc(const vector& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
-            __alloc() = _STD::move(__c.__alloc());
+            __alloc() = _VSTD::move(__c.__alloc());
         }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -2083,7 +2083,7 @@
     static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, true_type)
         _NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
         {
-            using _STD::swap;
+            using _VSTD::swap;
             swap(__x, __y);
         }
     _LIBCPP_INLINE_VISIBILITY
@@ -2169,7 +2169,7 @@
     const size_type __cap = capacity();
     if (__cap >= __ms / 2)
         return __ms;
-    return _STD::max(2*__cap, __align(__new_size));
+    return _VSTD::max(2*__cap, __align(__new_size));
 }
 
 //  Default constructs __n objects starting at __end_
@@ -2183,7 +2183,7 @@
 {
     size_type __old_size = this->__size_;
     this->__size_ += __n;
-    _STD::fill_n(__make_iter(__old_size), __n, __x);
+    _VSTD::fill_n(__make_iter(__old_size), __n, __x);
 }
 
 template <class _Allocator>
@@ -2196,8 +2196,8 @@
 vector<bool, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
 {
     size_type __old_size = this->__size_;
-    this->__size_ += _STD::distance(__first, __last);
-    _STD::copy(__first, __last, __make_iter(__old_size));
+    this->__size_ += _VSTD::distance(__first, __last);
+    _VSTD::copy(__first, __last, __make_iter(__old_size));
 }
 
 template <class _Allocator>
@@ -2320,7 +2320,7 @@
       __size_(0),
       __cap_alloc_(0)
 {
-    size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n > 0)
     {
         allocate(__n);
@@ -2336,7 +2336,7 @@
       __size_(0),
       __cap_alloc_(0, static_cast<__storage_allocator>(__a))
 {
-    size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
+    size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n > 0)
     {
         allocate(__n);
@@ -2422,7 +2422,7 @@
                 deallocate();
                 allocate(__v.__size_);
             }
-            _STD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);
+            _VSTD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);
         }
         __size_ = __v.__size_;
     }
@@ -2520,7 +2520,7 @@
             __v.__size_ = __n;
             swap(__v);
         }
-        _STD::fill_n(begin(), __n, __x);
+        _VSTD::fill_n(begin(), __n, __x);
     }
 }
 
@@ -2549,7 +2549,7 @@
 vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
 {
     clear();
-    difference_type __n = _STD::distance(__first, __last);
+    difference_type __n = _VSTD::distance(__first, __last);
     if (__n)
     {
         if (__n > capacity())
@@ -2632,7 +2632,7 @@
     {
         const_iterator __old_end = end();
         ++__size_;
-        _STD::copy_backward(__position, __old_end, end());
+        _VSTD::copy_backward(__position, __old_end, end());
         __r = __const_iterator_cast(__position);
     }
     else
@@ -2640,8 +2640,8 @@
         vector __v(__alloc());
         __v.reserve(__recommend(__size_ + 1));
         __v.__size_ = __size_ + 1;
-        __r = _STD::copy(cbegin(), __position, __v.begin());
-        _STD::copy_backward(__position, cend(), __v.end());
+        __r = _VSTD::copy(cbegin(), __position, __v.begin());
+        _VSTD::copy_backward(__position, cend(), __v.end());
         swap(__v);
     }
     *__r = __x;
@@ -2658,7 +2658,7 @@
     {
         const_iterator __old_end = end();
         __size_ += __n;
-        _STD::copy_backward(__position, __old_end, end());
+        _VSTD::copy_backward(__position, __old_end, end());
         __r = __const_iterator_cast(__position);
     }
     else
@@ -2666,11 +2666,11 @@
         vector __v(__alloc());
         __v.reserve(__recommend(__size_ + __n));
         __v.__size_ = __size_ + __n;
-        __r = _STD::copy(cbegin(), __position, __v.begin());
-        _STD::copy_backward(__position, cend(), __v.end());
+        __r = _VSTD::copy(cbegin(), __position, __v.begin());
+        _VSTD::copy_backward(__position, cend(), __v.end());
         swap(__v);
     }
-    _STD::fill_n(__r, __n, __x);
+    _VSTD::fill_n(__r, __n, __x);
     return __r;
 }
 
@@ -2714,7 +2714,7 @@
         }
 #endif  // _LIBCPP_NO_EXCEPTIONS
     }
-    __p = _STD::rotate(__p, __old_end, end());
+    __p = _VSTD::rotate(__p, __old_end, end());
     insert(__p, __v.begin(), __v.end());
     return begin() + __off;
 }
@@ -2728,14 +2728,14 @@
 >::type
 vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
 {
-    difference_type __n = _STD::distance(__first, __last);
+    difference_type __n = _VSTD::distance(__first, __last);
     iterator __r;
     size_type __c = capacity();
     if (__n <= __c && size() <= __c - __n)
     {
         const_iterator __old_end = end();
         __size_ += __n;
-        _STD::copy_backward(__position, __old_end, end());
+        _VSTD::copy_backward(__position, __old_end, end());
         __r = __const_iterator_cast(__position);
     }
     else
@@ -2743,11 +2743,11 @@
         vector __v(__alloc());
         __v.reserve(__recommend(__size_ + __n));
         __v.__size_ = __size_ + __n;
-        __r = _STD::copy(cbegin(), __position, __v.begin());
-        _STD::copy_backward(__position, cend(), __v.end());
+        __r = _VSTD::copy(cbegin(), __position, __v.begin());
+        _VSTD::copy_backward(__position, cend(), __v.end());
         swap(__v);
     }
-    _STD::copy(__first, __last, __r);
+    _VSTD::copy(__first, __last, __r);
     return __r;
 }
 
@@ -2757,7 +2757,7 @@
 vector<bool, _Allocator>::erase(const_iterator __position)
 {
     iterator __r = __const_iterator_cast(__position);
-    _STD::copy(__position + 1, this->cend(), __r);
+    _VSTD::copy(__position + 1, this->cend(), __r);
     --__size_;
     return __r;
 }
@@ -2768,7 +2768,7 @@
 {
     iterator __r = __const_iterator_cast(__first);
     difference_type __d = __last - __first;
-    _STD::copy(__last, this->cend(), __r);
+    _VSTD::copy(__last, this->cend(), __r);
     __size_ -= __d;
     return __r;
 }
@@ -2779,9 +2779,9 @@
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                    __is_nothrow_swappable<allocator_type>::value)
 {
-    _STD::swap(this->__begin_, __x.__begin_);
-    _STD::swap(this->__size_, __x.__size_);
-    _STD::swap(this->__cap(), __x.__cap());
+    _VSTD::swap(this->__begin_, __x.__begin_);
+    _VSTD::swap(this->__size_, __x.__size_);
+    _VSTD::swap(this->__cap(), __x.__cap());
     __swap_alloc(this->__alloc(), __x.__alloc());
 #ifdef _LIBCPP_DEBUG
     iterator::swap(this, &__x);
@@ -2809,10 +2809,10 @@
             vector __v(__alloc());
             __v.reserve(__recommend(__size_ + __n));
             __v.__size_ = __size_ + __n;
-            __r = _STD::copy(cbegin(), cend(), __v.begin());
+            __r = _VSTD::copy(cbegin(), cend(), __v.begin());
             swap(__v);
         }
-        _STD::fill_n(__r, __n, __x);
+        _VSTD::fill_n(__r, __n, __x);
     }
     else
         __size_ = __sz;
@@ -2890,7 +2890,7 @@
 operator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
 {
     const typename vector<_Tp, _Allocator>::size_type __sz = __x.size();
-    return __sz == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
+    return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Tp, class _Allocator>
@@ -2906,7 +2906,7 @@
 bool
 operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
 {
-    return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Tp, class _Allocator>
diff --git a/src/ios.cpp b/src/ios.cpp
index bca15fb..80917a0 100644
--- a/src/ios.cpp
+++ b/src/ios.cpp
@@ -165,7 +165,7 @@
         size_t newcap;
         const size_t mx = std::numeric_limits<size_t>::max();
         if (req_size < mx/2)
-            newcap = _STD::max(2 * __iarray_cap_, req_size);
+            newcap = _VSTD::max(2 * __iarray_cap_, req_size);
         else
             newcap = mx;
         long* iarray = (long*)realloc(__iarray_, newcap * sizeof(long));
@@ -193,7 +193,7 @@
         size_t newcap;
         const size_t mx = std::numeric_limits<size_t>::max();
         if (req_size < mx/2)
-            newcap = _STD::max(2 * __parray_cap_, req_size);
+            newcap = _VSTD::max(2 * __parray_cap_, req_size);
         else
             newcap = mx;
         void** parray = (void**)realloc(__parray_, newcap * sizeof(void*));
@@ -223,7 +223,7 @@
         size_t newcap;
         const size_t mx = std::numeric_limits<size_t>::max();
         if (req_size < mx/2)
-            newcap = _STD::max(2 * __event_cap_, req_size);
+            newcap = _VSTD::max(2 * __event_cap_, req_size);
         else
             newcap = mx;
         event_callback* fns = (event_callback*)realloc(__fn_, newcap * sizeof(event_callback));
@@ -403,24 +403,24 @@
 void
 ios_base::swap(ios_base& rhs)
 {
-    _STD::swap(__fmtflags_, rhs.__fmtflags_);
-    _STD::swap(__precision_, rhs.__precision_);
-    _STD::swap(__width_, rhs.__width_);
-    _STD::swap(__rdstate_, rhs.__rdstate_);
-    _STD::swap(__exceptions_, rhs.__exceptions_);
+    _VSTD::swap(__fmtflags_, rhs.__fmtflags_);
+    _VSTD::swap(__precision_, rhs.__precision_);
+    _VSTD::swap(__width_, rhs.__width_);
+    _VSTD::swap(__rdstate_, rhs.__rdstate_);
+    _VSTD::swap(__exceptions_, rhs.__exceptions_);
     locale& lhs_loc = *(locale*)&__loc_;
     locale& rhs_loc = *(locale*)&rhs.__loc_;
-    _STD::swap(lhs_loc, rhs_loc);
-    _STD::swap(__fn_, rhs.__fn_);
-    _STD::swap(__index_, rhs.__index_);
-    _STD::swap(__event_size_, rhs.__event_size_);
-    _STD::swap(__event_cap_, rhs.__event_cap_);
-    _STD::swap(__iarray_, rhs.__iarray_);
-    _STD::swap(__iarray_size_, rhs.__iarray_size_);
-    _STD::swap(__iarray_cap_, rhs.__iarray_cap_);
-    _STD::swap(__parray_, rhs.__parray_);
-    _STD::swap(__parray_size_, rhs.__parray_size_);
-    _STD::swap(__parray_cap_, rhs.__parray_cap_);
+    _VSTD::swap(lhs_loc, rhs_loc);
+    _VSTD::swap(__fn_, rhs.__fn_);
+    _VSTD::swap(__index_, rhs.__index_);
+    _VSTD::swap(__event_size_, rhs.__event_size_);
+    _VSTD::swap(__event_cap_, rhs.__event_cap_);
+    _VSTD::swap(__iarray_, rhs.__iarray_);
+    _VSTD::swap(__iarray_size_, rhs.__iarray_size_);
+    _VSTD::swap(__iarray_cap_, rhs.__iarray_cap_);
+    _VSTD::swap(__parray_, rhs.__parray_);
+    _VSTD::swap(__parray_size_, rhs.__parray_size_);
+    _VSTD::swap(__parray_cap_, rhs.__parray_cap_);
 }
 
 void
diff --git a/src/iostream.cpp b/src/iostream.cpp
index b4b29c8..157c397 100644
--- a/src/iostream.cpp
+++ b/src/iostream.cpp
@@ -33,11 +33,11 @@
 ios_base::Init::Init()
 {
     cin.tie(&cout);
-    _STD::unitbuf(cerr);
+    _VSTD::unitbuf(cerr);
     cerr.tie(&cout);
 
     wcin.tie(&wcout);
-    _STD::unitbuf(wcerr);
+    _VSTD::unitbuf(wcerr);
     wcerr.tie(&wcout);
 }
 
diff --git a/src/locale.cpp b/src/locale.cpp
index 8f44ab0..8e4f383 100644
--- a/src/locale.cpp
+++ b/src/locale.cpp
@@ -41,7 +41,7 @@
   using ::localeconv_l;
   using ::mbsrtowcs_l;
 
-  decltype(MB_CUR_MAX_L(_STD::declval<locale_t>()))
+  decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
   inline _LIBCPP_INLINE_VISIBILITY
   mb_cur_max_l(locale_t loc)
   {
@@ -188,10 +188,10 @@
       facets_(N)
 {
     facets_.clear();
-    install(&make<_STD::collate<char> >(1));
-    install(&make<_STD::collate<wchar_t> >(1));
-    install(&make<_STD::ctype<char> >((ctype_base::mask*)0, false, 1));
-    install(&make<_STD::ctype<wchar_t> >(1));
+    install(&make<_VSTD::collate<char> >(1));
+    install(&make<_VSTD::collate<wchar_t> >(1));
+    install(&make<_VSTD::ctype<char> >((ctype_base::mask*)0, false, 1));
+    install(&make<_VSTD::ctype<wchar_t> >(1));
     install(&make<codecvt<char, char, mbstate_t> >(1));
     install(&make<codecvt<wchar_t, char, mbstate_t> >(1));
     install(&make<codecvt<char16_t, char, mbstate_t> >(1));
@@ -214,8 +214,8 @@
     install(&make<time_get<wchar_t> >(1));
     install(&make<time_put<char> >(1));
     install(&make<time_put<wchar_t> >(1));
-    install(&make<_STD::messages<char> >(1));
-    install(&make<_STD::messages<wchar_t> >(1));
+    install(&make<_VSTD::messages<char> >(1));
+    install(&make<_VSTD::messages<wchar_t> >(1));
 }
 
 locale::__imp::__imp(const string& name, size_t refs)
@@ -358,17 +358,17 @@
 #endif  // _LIBCPP_NO_EXCEPTIONS
         if (c & locale::collate)
         {
-            install_from<_STD::collate<char> >(one);
-            install_from<_STD::collate<wchar_t> >(one);
+            install_from<_VSTD::collate<char> >(one);
+            install_from<_VSTD::collate<wchar_t> >(one);
         }
         if (c & locale::ctype)
         {
-            install_from<_STD::ctype<char> >(one);
-            install_from<_STD::ctype<wchar_t> >(one);
-            install_from<_STD::codecvt<char, char, mbstate_t> >(one);
-            install_from<_STD::codecvt<char16_t, char, mbstate_t> >(one);
-            install_from<_STD::codecvt<char32_t, char, mbstate_t> >(one);
-            install_from<_STD::codecvt<wchar_t, char, mbstate_t> >(one);
+            install_from<_VSTD::ctype<char> >(one);
+            install_from<_VSTD::ctype<wchar_t> >(one);
+            install_from<_VSTD::codecvt<char, char, mbstate_t> >(one);
+            install_from<_VSTD::codecvt<char16_t, char, mbstate_t> >(one);
+            install_from<_VSTD::codecvt<char32_t, char, mbstate_t> >(one);
+            install_from<_VSTD::codecvt<wchar_t, char, mbstate_t> >(one);
         }
         if (c & locale::monetary)
         {
@@ -399,8 +399,8 @@
         }
         if (c & locale::messages)
         {
-            install_from<_STD::messages<char> >(one);
-            install_from<_STD::messages<wchar_t> >(one);
+            install_from<_VSTD::messages<char> >(one);
+            install_from<_VSTD::messages<wchar_t> >(one);
         }
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
diff --git a/src/regex.cpp b/src/regex.cpp
index a29ed73..65e9f88 100644
--- a/src/regex.cpp
+++ b/src/regex.cpp
@@ -229,7 +229,7 @@
 __get_collation_name(const char* s)
 {
     const collationnames* i =
-            _STD::lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
+            _VSTD::lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
     string r;
     if (i != end(collatenames) && strcmp(s, i->elem_) == 0)
         r = char(i->char_);
@@ -240,7 +240,7 @@
 __get_classname(const char* s, bool __icase)
 {
     const classnames* i =
-            _STD::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
+            _VSTD::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
     ctype_base::mask r = 0;
     if (i != end(ClassNames) && strcmp(s, i->elem_) == 0)
     {
diff --git a/src/strstream.cpp b/src/strstream.cpp
index ef12f98..c2b7f42 100644
--- a/src/strstream.cpp
+++ b/src/strstream.cpp
@@ -150,10 +150,10 @@
 strstreambuf::swap(strstreambuf& __rhs)
 {
     streambuf::swap(__rhs);
-    _STD::swap(__strmode_, __rhs.__strmode_);
-    _STD::swap(__alsize_, __rhs.__alsize_);
-    _STD::swap(__palloc_, __rhs.__palloc_);
-    _STD::swap(__pfree_, __rhs.__pfree_);
+    _VSTD::swap(__strmode_, __rhs.__strmode_);
+    _VSTD::swap(__alsize_, __rhs.__alsize_);
+    _VSTD::swap(__palloc_, __rhs.__palloc_);
+    _VSTD::swap(__pfree_, __rhs.__pfree_);
 }
 
 void
@@ -302,7 +302,7 @@
         {
             char* newpos = eback() + newoff;
             if (pos_in)
-                setg(eback(), newpos, _STD::max(newpos, egptr()));
+                setg(eback(), newpos, _VSTD::max(newpos, egptr()));
             if (pos_out)
             {
                 // min(pbase, newpos), newpos, epptr()
@@ -332,7 +332,7 @@
             {
                 char* newpos = eback() + newoff;
                 if (pos_in)
-                    setg(eback(), newpos, _STD::max(newpos, egptr()));
+                    setg(eback(), newpos, _VSTD::max(newpos, egptr()));
                 if (pos_out)
                 {
                     // min(pbase, newpos), newpos, epptr()
diff --git a/src/system_error.cpp b/src/system_error.cpp
index caafc32..763d62c 100644
--- a/src/system_error.cpp
+++ b/src/system_error.cpp
@@ -147,7 +147,7 @@
             what_arg += ": ";
         what_arg += ec.message();
     }
-    return _STD::move(what_arg);
+    return _VSTD::move(what_arg);
 }
 
 system_error::system_error(error_code ec, const string& what_arg)
