diff --git a/include/__hash_table b/include/__hash_table
index ae9ee1c..4be27f6 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -85,7 +85,7 @@
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return addressof(__node_->__value_);}
+        pointer operator->() const {return _STD::addressof(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_iterator& operator++()
@@ -163,7 +163,7 @@
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return addressof(__node_->__value_);}
+        pointer operator->() const {return _STD::addressof(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_iterator& operator++()
@@ -433,7 +433,7 @@
     void operator()(pointer __p)
     {
         if (__value_constructed)
-            __alloc_traits::destroy(__na_, addressof(__p->__value_));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -798,7 +798,7 @@
     if (size() > 0)
     {
         __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
-            static_cast<__node_pointer>(addressof(__p1_.first()));
+            static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -822,7 +822,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>(addressof(__p1_.first()));
+                static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
             size() = __u.size();
             __u.size() = 0;
         }
@@ -875,7 +875,7 @@
     while (__np != nullptr)
     {
         __node_pointer __next = __np->__next_;
-        __node_traits::destroy(__na, addressof(__np->__value_));
+        __node_traits::destroy(__na, _STD::addressof(__np->__value_));
         __node_traits::deallocate(__na, __np, 1);
         __np = __next;
     }
@@ -914,7 +914,7 @@
     if (size() > 0)
     {
         __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
-            static_cast<__node_pointer>(addressof(__p1_.first()));
+            static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -1131,7 +1131,7 @@
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
             __nd->__next_ = __pn->__next_;
             __pn->__next_ = __nd;
             // fix up __bucket_list_
@@ -1169,7 +1169,7 @@
     __node_pointer __pn = __bucket_list_[__chash];
     if (__pn == nullptr)
     {
-        __pn = static_cast<__node_pointer>(addressof(__p1_.first()));
+        __pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
         __cp->__next_ = __pn->__next_;
         __pn->__next_ = __cp;
         // fix up __bucket_list_
@@ -1275,7 +1275,7 @@
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
             __h->__next_ = __pn->__next_;
             __pn->__next_ = __h.get();
             // fix up __bucket_list_
@@ -1433,7 +1433,7 @@
     {
         for (size_type __i = 0; __i < __nbc; ++__i)
             __bucket_list_[__i] = nullptr;
-        __node_pointer __pp(static_cast<__node_pointer>(addressof(__p1_.first())));
+        __node_pointer __pp(static_cast<__node_pointer>(_STD::addressof(__p1_.first())));
         __node_pointer __cp = __pp->__next_;
         if (__cp != nullptr)
         {
@@ -1533,7 +1533,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_Args>(__args)...);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = hash_function()(__h->__value_);
     __h->__next_ = nullptr;
@@ -1549,7 +1549,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), _STD::move(__v));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::move(__v));
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = __hash;
     __h->__next_ = nullptr;
@@ -1564,7 +1564,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), __v);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = hash_function()(__h->__value_);
     __h->__next_ = nullptr;
@@ -1580,7 +1580,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), __v);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = __hash;
     __h->__next_ = nullptr;
@@ -1658,7 +1658,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 == addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash)
+    if (__pn == _STD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash)
     {
         if (__cn->__next_ == nullptr || __cn->__next_->__hash_ % __bc != __chash)
             __bucket_list_[__chash] = nullptr;
@@ -1791,10 +1791,10 @@
     __p3_.swap(__u.__p3_);
     if (size() > 0)
         __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
-            static_cast<__node_pointer>(addressof(__p1_.first()));
+            static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
     if (__u.size() > 0)
         __u.__bucket_list_[__u.__p1_.first().__next_->__hash_ % __u.bucket_count()] =
-            static_cast<__node_pointer>(addressof(__u.__p1_.first()));
+            static_cast<__node_pointer>(_STD::addressof(__u.__p1_.first()));
 }
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
diff --git a/include/__tree b/include/__tree
index b49e9e4..7796242 100644
--- a/include/__tree
+++ b/include/__tree
@@ -523,7 +523,7 @@
     void operator()(pointer __p)
     {
         if (__value_constructed)
-            __alloc_traits::destroy(__na_, addressof(__p->__value_));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -1373,7 +1373,7 @@
         destroy(static_cast<__node_pointer>(__nd->__left_));
         destroy(static_cast<__node_pointer>(__nd->__right_));
         __node_allocator& __na = __node_alloc();
-        __node_traits::destroy(__na, addressof(__nd->__value_));
+        __node_traits::destroy(__na, _STD::addressof(__nd->__value_));
         __node_traits::deallocate(__na, __nd, 1);
     }
 }
@@ -1655,7 +1655,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_Args>(__args)...);
     __h.get_deleter().__value_constructed = true;
     return __h;
 }
@@ -1791,7 +1791,7 @@
 {
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), __v);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
     __h.get_deleter().__value_constructed = true;
     return _STD::move(__h);
 }
@@ -1919,7 +1919,7 @@
         __begin_node() = __r.__ptr_;
     --size();
     __node_allocator& __na = __node_alloc();
-    __node_traits::destroy(__na, const_cast<value_type*>(addressof(*__p)));
+    __node_traits::destroy(__na, const_cast<value_type*>(_STD::addressof(*__p)));
     __tree_remove(__end_node()->__left_,
                   static_cast<__node_base_pointer>(__np));
     __node_traits::deallocate(__na, __np, 1);
diff --git a/include/deque b/include/deque
index 9bf301c..a704d4e 100644
--- a/include/deque
+++ b/include/deque
@@ -1116,7 +1116,7 @@
 {
     allocator_type& __a = __alloc();
     for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
-        __alloc_traits::destroy(__a, addressof(*__i));
+        __alloc_traits::destroy(__a, _STD::addressof(*__i));
     size() = 0;
     while (__map_.size() > 2)
     {
@@ -1675,7 +1675,7 @@
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, addressof(*__base::end()), __v);
+    __alloc_traits::construct(__a, _STD::addressof(*__base::end()), __v);
     ++__base::size();
 }
 
@@ -1689,7 +1689,7 @@
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, addressof(*__base::end()), _STD::move(__v));
+    __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::move(__v));
     ++__base::size();
 }
 
@@ -1704,7 +1704,7 @@
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, addressof(*__base::end()), _STD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::forward<_Args>(__args)...);
     ++__base::size();
 }
 
@@ -1719,7 +1719,7 @@
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, addressof(*--__base::begin()), __v);
+    __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), __v);
     --__base::__start_;
     ++__base::size();
 }
@@ -1734,7 +1734,7 @@
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, addressof(*--__base::begin()), _STD::move(__v));
+    __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::move(__v));
     --__base::__start_;
     ++__base::size();
 }
@@ -1750,7 +1750,7 @@
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
     --__base::__start_;
     ++__base::size();
 }
@@ -1772,7 +1772,7 @@
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, addressof(*--__base::begin()), __v);
+            __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), __v);
             --__base::__start_;
             ++__base::size();
         }
@@ -1783,7 +1783,7 @@
             iterator __bm1 = prev(__b);
             if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
                 __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
-            __alloc_traits::construct(__a, addressof(*__bm1), _STD::move(*__b));
+            __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
@@ -1799,7 +1799,7 @@
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, addressof(*__base::end()), __v);
+            __alloc_traits::construct(__a, _STD::addressof(*__base::end()), __v);
             ++__base::size();
         }
         else
@@ -1809,7 +1809,7 @@
             iterator __em1 = prev(__e);
             if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
                 __vt = pointer_traits<const_pointer>::pointer_to(*__e);
-            __alloc_traits::construct(__a, addressof(*__e), _STD::move(*__em1));
+            __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
             ++__base::size();
             if (__de > 1)
                 __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
@@ -1835,7 +1835,7 @@
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, addressof(*--__base::begin()), _STD::move(__v));
+            __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::move(__v));
             --__base::__start_;
             ++__base::size();
         }
@@ -1843,7 +1843,7 @@
         {
             iterator __b = __base::begin();
             iterator __bm1 = prev(__b);
-            __alloc_traits::construct(__a, addressof(*__bm1), _STD::move(*__b));
+            __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
@@ -1859,14 +1859,14 @@
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, addressof(*__base::end()), _STD::move(__v));
+            __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::move(__v));
             ++__base::size();
         }
         else
         {
             iterator __e = __base::end();
             iterator __em1 = prev(__e);
-            __alloc_traits::construct(__a, addressof(*__e), _STD::move(*__em1));
+            __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
             ++__base::size();
             if (__de > 1)
                 __e = _STD::move_backward(__e - __de, __em1, __e);
@@ -1893,7 +1893,7 @@
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
             --__base::__start_;
             ++__base::size();
         }
@@ -1901,7 +1901,7 @@
         {
             iterator __b = __base::begin();
             iterator __bm1 = prev(__b);
-            __alloc_traits::construct(__a, addressof(*__bm1), _STD::move(*__b));
+            __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
@@ -1917,14 +1917,14 @@
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, addressof(*__base::end()), _STD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::forward<_Args>(__args)...);
             ++__base::size();
         }
         else
         {
             iterator __e = __base::end();
             iterator __em1 = prev(__e);
-            __alloc_traits::construct(__a, addressof(*__e), _STD::move(*__em1));
+            __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
             ++__base::size();
             if (__de > 1)
                 __e = _STD::move_backward(__e - __de, __em1, __e);
@@ -1955,7 +1955,7 @@
         if (__n > __pos)
         {
             for (size_type __m = __n - __pos; __m; --__m, --__base::__start_, ++__base::size())
-                __alloc_traits::construct(__a, addressof(*--__i), __v);
+                __alloc_traits::construct(__a, _STD::addressof(*--__i), __v);
             __n = __pos;
         }
         if (__n > 0)
@@ -1981,7 +1981,7 @@
         if (__n > __de)
         {
             for (size_type __m = __n - __de; __m; --__m, ++__i, ++__base::size())
-                __alloc_traits::construct(__a, addressof(*__i), __v);
+                __alloc_traits::construct(__a, _STD::addressof(*__i), __v);
             __n = __de;
         }
         if (__n > 0)
@@ -2033,7 +2033,7 @@
         {
             __m = __pos < __n / 2 ? _STD::prev(__l, __pos) : _STD::next(__f, __n - __pos);
             for (_BiIter __j = __m; __j != __f; --__base::__start_, ++__base::size())
-                __alloc_traits::construct(__a, addressof(*--__i), *--__j);
+                __alloc_traits::construct(__a, _STD::addressof(*--__i), *--__j);
             __n = __pos;
         }
         if (__n > 0)
@@ -2041,7 +2041,7 @@
             iterator __obn = __old_begin + __n;
             for (iterator __j = __obn; __j != __old_begin;)
             {
-                __alloc_traits::construct(__a, addressof(*--__i), _STD::move(*--__j));
+                __alloc_traits::construct(__a, _STD::addressof(*--__i), _STD::move(*--__j));
                 --__base::__start_;
                 ++__base::size();
             }
@@ -2065,14 +2065,14 @@
         {
             __m = __de < __n / 2 ? _STD::next(__f, __de) : _STD::prev(__l, __n - __de);
             for (_BiIter __j = __m; __j != __l; ++__i, ++__j, ++__base::size())
-                __alloc_traits::construct(__a, addressof(*__i), *__j);
+                __alloc_traits::construct(__a, _STD::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, addressof(*__i), _STD::move(*__j));
+                __alloc_traits::construct(__a, _STD::addressof(*__i), _STD::move(*__j));
             if (__n < __de)
                 __old_end = _STD::move_backward(__old_end - __de, __oen, __old_end);
             _STD::copy_backward(__f, __m, __old_end);
@@ -2105,7 +2105,7 @@
         __add_back_capacity(__n - __back_capacity);
     // __n <= __back_capacity
     for (iterator __i = __base::end(); __f != __l; ++__i, ++__f, ++__base::size())
-        __alloc_traits::construct(__a, addressof(*__i), *__f);
+        __alloc_traits::construct(__a, _STD::addressof(*__i), *__f);
 }
 
 template <class _Tp, class _Allocator>
@@ -2118,7 +2118,7 @@
         __add_back_capacity(__n - __back_capacity);
     // __n <= __back_capacity
     for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
-        __alloc_traits::construct(__a, addressof(*__i));
+        __alloc_traits::construct(__a, _STD::addressof(*__i));
 }
 
 template <class _Tp, class _Allocator>
@@ -2131,7 +2131,7 @@
         __add_back_capacity(__n - __back_capacity);
     // __n <= __back_capacity
     for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
-        __alloc_traits::construct(__a, addressof(*__i), __v);
+        __alloc_traits::construct(__a, _STD::addressof(*__i), __v);
 }
 
 // Create front capacity for one block of elements.
@@ -2536,7 +2536,7 @@
     allocator_type& __a = __base::__alloc();
     // as if
     //   for (; __f != __l; ++__r, ++__f, ++__base::size())
-    //       __alloc_traits::construct(__a, addressof(*__r), _STD::move(*__f));
+    //       __alloc_traits::construct(__a, _STD::addressof(*__r), _STD::move(*__f));
     difference_type __n = __l - __f;
     while (__n > 0)
     {
@@ -2551,7 +2551,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, addressof(*__r), _STD::move(*__fb));
+            __alloc_traits::construct(__a, _STD::addressof(*__r), _STD::move(*__fb));
         __n -= __bs;
         __f += __bs;
     }
@@ -2568,7 +2568,7 @@
     // as if
     //   for (iterator __j = __l; __j != __f;)
     //   {
-    //       __alloc_traitsconstruct(__a, addressof(*--__r), _STD::move(*--__j));
+    //       __alloc_traitsconstruct(__a, _STD::addressof(*--__r), _STD::move(*--__j));
     //       --__base::__start_;
     //       ++__base::size();
     //   }
@@ -2588,7 +2588,7 @@
             __vt = (const_iterator(__l.__m_iter_, __vt) -= __l - __r + 1).__ptr_;
         while (__le != __lb)
         {
-            __alloc_traits::construct(__a, addressof(*--__r), _STD::move(*--__le));
+            __alloc_traits::construct(__a, _STD::addressof(*--__r), _STD::move(*--__le));
             --__base::__start_;
             ++__base::size();
         }
@@ -2609,7 +2609,7 @@
     if (__pos < (__base::size() - 1) / 2)
     {   // erase from front
         _STD::move_backward(__b, __p, next(__p));
-        __alloc_traits::destroy(__a, addressof(*__b));
+        __alloc_traits::destroy(__a, _STD::addressof(*__b));
         --__base::size();
         ++__base::__start_;
         if (__front_spare() >= 2 * __base::__block_size)
@@ -2622,7 +2622,7 @@
     else
     {   // erase from back
         iterator __i = _STD::move(next(__p), __base::end(), __p);
-        __alloc_traits::destroy(__a, addressof(*__i));
+        __alloc_traits::destroy(__a, _STD::addressof(*__i));
         --__base::size();
         if (__back_spare() >= 2 * __base::__block_size)
         {
@@ -2648,7 +2648,7 @@
         {   // erase from front
             iterator __i = _STD::move_backward(__b, __p, __p + __n);
             for (; __b != __i; ++__b)
-                __alloc_traits::destroy(__a, addressof(*__b));
+                __alloc_traits::destroy(__a, _STD::addressof(*__b));
             __base::size() -= __n;
             __base::__start_ += __n;
             while (__front_spare() >= 2 * __base::__block_size)
@@ -2662,7 +2662,7 @@
         {   // erase from back
             iterator __i = _STD::move(__p + __n, __base::end(), __p);
             for (iterator __e = __base::end(); __i != __e; ++__i)
-                __alloc_traits::destroy(__a, addressof(*__i));
+                __alloc_traits::destroy(__a, _STD::addressof(*__i));
             __base::size() -= __n;
             while (__back_spare() >= 2 * __base::__block_size)
             {
@@ -2686,7 +2686,7 @@
         iterator __b = __base::begin();
         difference_type __pos = __f - __b;
         for (iterator __p = __b + __pos; __p != __e; ++__p)
-            __alloc_traits::destroy(__a, addressof(*__p));
+            __alloc_traits::destroy(__a, _STD::addressof(*__p));
         __base::size() -= __n;
         while (__back_spare() >= 2 * __base::__block_size)
         {
diff --git a/include/ext/hash_map b/include/ext/hash_map
index c5506aa..9a0b9ee 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_, addressof(__p->__value_.second));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, addressof(__p->__value_.first));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -666,9 +666,9 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first), __k);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return _STD::move(__h);
 }
diff --git a/include/forward_list b/include/forward_list
index 18d8716..6066475 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -492,7 +492,7 @@
     for (__node_pointer __p = __before_begin()->__next_; __p != nullptr;)
     {
         __node_pointer __next = __p->__next_;
-        __node_traits::destroy(__a, addressof(__p->__value_));
+        __node_traits::destroy(__a, _STD::addressof(__p->__value_));
         __node_traits::deallocate(__a, __p, 1);
         __p = __next;
     }
@@ -712,7 +712,7 @@
                                                              __p = __p->__next_)
         {
             __h.reset(__node_traits::allocate(__a, 1));
-            __node_traits::construct(__a, addressof(__h->__value_));
+            __node_traits::construct(__a, _STD::addressof(__h->__value_));
             __h->__next_ = nullptr;
             __p->__next_ = __h.release();
         }
@@ -915,7 +915,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, addressof(__h->__value_),
+    __node_traits::construct(__a, _STD::addressof(__h->__value_),
                                   _STD::forward<_Args>(__args)...);
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
@@ -930,7 +930,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, addressof(__h->__value_), _STD::move(__v));
+    __node_traits::construct(__a, _STD::addressof(__h->__value_), _STD::move(__v));
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
 }
@@ -944,7 +944,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, addressof(__h->__value_), __v);
+    __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
 }
@@ -956,7 +956,7 @@
     __node_allocator& __a = base::__alloc();
     __node_pointer __p = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __p->__next_;
-    __node_traits::destroy(__a, addressof(__p->__value_));
+    __node_traits::destroy(__a, _STD::addressof(__p->__value_));
     __node_traits::deallocate(__a, __p, 1);
 }
 
@@ -972,7 +972,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, addressof(__h->__value_),
+    __node_traits::construct(__a, _STD::addressof(__h->__value_),
                                   _STD::forward<_Args>(__args)...);
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
@@ -989,7 +989,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, addressof(__h->__value_), _STD::move(__v));
+    __node_traits::construct(__a, _STD::addressof(__h->__value_), _STD::move(__v));
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
@@ -1005,7 +1005,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, addressof(__h->__value_), __v);
+    __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
@@ -1022,7 +1022,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, addressof(__h->__value_), __v);
+        __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
         __node_pointer __first = __h.release();
         __node_pointer __last = __first;
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1032,7 +1032,7 @@
             for (--__n; __n != 0; --__n, __last = __last->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, addressof(__h->__value_), __v);
+                __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
                 __last->__next_ = __h.release();
             }
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1042,7 +1042,7 @@
             while (__first != nullptr)
             {
                 __node_pointer __next = __first->__next_;
-                __node_traits::destroy(__a, addressof(__first->__value_));
+                __node_traits::destroy(__a, _STD::addressof(__first->__value_));
                 __node_traits::deallocate(__a, __first, 1);
                 __first = __next;
             }
@@ -1072,7 +1072,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, addressof(__h->__value_), *__f);
+        __node_traits::construct(__a, _STD::addressof(__h->__value_), *__f);
         __node_pointer __first = __h.release();
         __node_pointer __last = __first;
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1082,7 +1082,7 @@
             for (++__f; __f != __l; ++__f, __last = __last->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, addressof(__h->__value_), *__f);
+                __node_traits::construct(__a, _STD::addressof(__h->__value_), *__f);
                 __last->__next_ = __h.release();
             }
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1092,7 +1092,7 @@
             while (__first != nullptr)
             {
                 __node_pointer __next = __first->__next_;
-                __node_traits::destroy(__a, addressof(__first->__value_));
+                __node_traits::destroy(__a, _STD::addressof(__first->__value_));
                 __node_traits::deallocate(__a, __first, 1);
                 __first = __next;
             }
@@ -1114,7 +1114,7 @@
     __node_pointer __n = __p->__next_;
     __p->__next_ = __n->__next_;
     __node_allocator& __a = base::__alloc();
-    __node_traits::destroy(__a, addressof(__n->__value_));
+    __node_traits::destroy(__a, _STD::addressof(__n->__value_));
     __node_traits::deallocate(__a, __n, 1);
     return iterator(__p->__next_);
 }
@@ -1135,7 +1135,7 @@
             do
             {
                 __p = __n->__next_;
-                __node_traits::destroy(__a, addressof(__n->__value_));
+                __node_traits::destroy(__a, _STD::addressof(__n->__value_));
                 __node_traits::deallocate(__a, __n, 1);
                 __n = __p;
             } while (__n != __e);
@@ -1168,7 +1168,7 @@
                                                          __ptr = __ptr->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, addressof(__h->__value_));
+                __node_traits::construct(__a, _STD::addressof(__h->__value_));
                 __h->__next_ = nullptr;
                 __ptr->__next_ = __h.release();
             }
@@ -1200,7 +1200,7 @@
                                                          __ptr = __ptr->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, addressof(__h->__value_), __v);
+                __node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
                 __h->__next_ = nullptr;
                 __ptr->__next_ = __h.release();
             }
diff --git a/include/list b/include/list
index d5c6ca5..6c4bc0d 100644
--- a/include/list
+++ b/include/list
@@ -473,8 +473,8 @@
         {
             __node& __n = *__f.__ptr_;
             ++__f;
-            __node_alloc_traits::destroy(__na, addressof(__n.__value_));
-            __node_alloc_traits::deallocate(__na, addressof(__n), 1);
+            __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
+            __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
         }
     }
 }
@@ -915,7 +915,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, addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
     __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
     ++base::__sz();
     return iterator(__hold.release());
@@ -933,7 +933,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, addressof(__hold->__value_), __x);
+        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
         ++__ds;
         __r = iterator(__hold.get());
         __hold.release();
@@ -945,7 +945,7 @@
             for (--__n; __n != 0; --__n, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, addressof(__hold->__value_), __x);
+                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -956,7 +956,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, addressof(*__e));
+                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
@@ -986,7 +986,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, addressof(__hold->__value_), *__f);
+        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), *__f);
         ++__ds;
         __r = iterator(__hold.get());
         __hold.release();
@@ -998,7 +998,7 @@
             for (++__f; __f != __l; ++__f, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, addressof(__hold->__value_), *__f);
+                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), *__f);
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -1009,7 +1009,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, addressof(*__e));
+                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
@@ -1032,7 +1032,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, addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
     __link_nodes(*base::__end_.__next_, *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1045,7 +1045,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, addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
     __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1060,7 +1060,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, addressof(__hold->__value_), _STD::move(__x));
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::move(__x));
     __link_nodes(*base::__end_.__next_, *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1073,7 +1073,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, addressof(__hold->__value_), _STD::move(__x));
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::move(__x));
     __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1089,7 +1089,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, addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
     __link_nodes(*base::__end_.__next_, *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1103,7 +1103,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, addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
     __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
     ++base::__sz();
     __hold.release();
@@ -1118,7 +1118,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, addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::forward<_Args>(__args)...);
     __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
     ++base::__sz();
     return iterator(__hold.release());
@@ -1134,7 +1134,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, addressof(__hold->__value_), _STD::move(__x));
+    __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), _STD::move(__x));
     __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
     ++base::__sz();
     return iterator(__hold.release());
@@ -1150,8 +1150,8 @@
     __node& __n = *base::__end_.__next_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-    __node_alloc_traits::destroy(__na, addressof(__n.__value_));
-    __node_alloc_traits::deallocate(__na, addressof(__n), 1);
+    __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
+    __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
 }
 
 template <class _Tp, class _Alloc>
@@ -1162,8 +1162,8 @@
     __node& __n = *base::__end_.__prev_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-    __node_alloc_traits::destroy(__na, addressof(__n.__value_));
-    __node_alloc_traits::deallocate(__na, addressof(__n), 1);
+    __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
+    __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
 }
 
 template <class _Tp, class _Alloc>
@@ -1175,8 +1175,8 @@
     __node_pointer __r = __n.__next_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-    __node_alloc_traits::destroy(__na, addressof(__n.__value_));
-    __node_alloc_traits::deallocate(__na, addressof(__n), 1);
+    __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
+    __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
     return iterator(__r);
 }
 
@@ -1193,8 +1193,8 @@
             __node& __n = const_cast<__node&>(*__f.__ptr_);
             ++__f;
             --base::__sz();
-            __node_alloc_traits::destroy(__na, addressof(__n.__value_));
-            __node_alloc_traits::deallocate(__na, addressof(__n), 1);
+            __node_alloc_traits::destroy(__na, _STD::addressof(__n.__value_));
+            __node_alloc_traits::deallocate(__na, _STD::addressof(__n), 1);
         }
     }
     return iterator(const_cast<__node_pointer>(__l.__ptr_));
@@ -1214,7 +1214,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, addressof(__hold->__value_));
+        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_));
         ++__ds;
         iterator __r = iterator(__hold.release());
         iterator __e = __r;
@@ -1225,7 +1225,7 @@
             for (--__n; __n != 0; --__n, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, addressof(__hold->__value_));
+                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_));
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -1236,7 +1236,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, addressof(*__e));
+                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
@@ -1265,7 +1265,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, addressof(__hold->__value_), __x);
+        __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
         ++__ds;
         iterator __r = iterator(__hold.release());
         iterator __e = __r;
@@ -1276,7 +1276,7 @@
             for (--__n; __n != 0; --__n, ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, addressof(__hold->__value_), __x);
+                __node_alloc_traits::construct(__na, _STD::addressof(__hold->__value_), __x);
                 __e.__ptr_->__next_ = __hold.get();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
@@ -1287,7 +1287,7 @@
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, addressof(*__e));
+                __node_alloc_traits::destroy(__na, _STD::addressof(*__e));
                 __node_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
                 if (__prev == 0)
diff --git a/include/map b/include/map
index 387c6b5..6b7bff6 100644
--- a/include/map
+++ b/include/map
@@ -475,9 +475,9 @@
     void operator()(pointer __p)
     {
         if (__second_constructed)
-            __alloc_traits::destroy(__na_, addressof(__p->__value_.second));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, addressof(__p->__value_.first));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -1131,9 +1131,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1146,7 +1146,7 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -1162,9 +1162,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1179,9 +1179,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first), __k);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return _STD::move(__h);
 }
@@ -1685,9 +1685,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1701,7 +1701,7 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -1718,9 +1718,9 @@
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
diff --git a/include/memory b/include/memory
index f50128c..f91262d 100644
--- a/include/memory
+++ b/include/memory
@@ -1525,8 +1525,8 @@
 
     _LIBCPP_INLINE_VISIBILITY allocator() throw() {}
     template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) throw() {}
-    _LIBCPP_INLINE_VISIBILITY pointer address(reference __x) const             {return addressof(__x);}
-    _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const {return addressof(__x);}
+    _LIBCPP_INLINE_VISIBILITY pointer address(reference __x) const             {return _STD::addressof(__x);}
+    _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const {return _STD::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) {::operator delete((void*)__p);}
diff --git a/include/unordered_map b/include/unordered_map
index 56f1ee1..f2c5d71 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -424,9 +424,9 @@
     void operator()(pointer __p)
     {
         if (__second_constructed)
-            __alloc_traits::destroy(__na_, addressof(__p->__value_.second));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, addressof(__p->__value_.first));
+            __alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -979,10 +979,10 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first),
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first),
                              _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second),
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second),
                              _STD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -999,7 +999,7 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_),
+    __node_traits::construct(__na, _STD::addressof(__h->__value_),
                              _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
@@ -1032,9 +1032,9 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first), __k);
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second));
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return _STD::move(__h);
 }
@@ -1560,10 +1560,10 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_.first),
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.first),
                              _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, addressof(__h->__value_.second),
+    __node_traits::construct(__na, _STD::addressof(__h->__value_.second),
                              _STD::forward<_Args>(__args)...);
     __h.get_deleter().__second_constructed = true;
     return __h;
@@ -1580,7 +1580,7 @@
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
-    __node_traits::construct(__na, addressof(__h->__value_),
+    __node_traits::construct(__na, _STD::addressof(__h->__value_),
                              _STD::forward<_A0>(__a0));
     __h.get_deleter().__first_constructed = true;
     __h.get_deleter().__second_constructed = true;
