diff --git a/include/__std_stream b/include/__std_stream
index f6b3fd2..7dfb0c9 100644
--- a/include/__std_stream
+++ b/include/__std_stream
@@ -97,7 +97,7 @@
 __stdinbuf<_CharT>::__getchar(bool __consume)
 {
     char __extbuf[__limit];
-    int __nread = max(1, __encoding_);
+    int __nread = _STD::max(1, __encoding_);
     for (int __i = 0; __i < __nread; ++__i)
     {
         char __c = getc(__file_);
diff --git a/include/algorithm b/include/algorithm
index a3764df..d91c57c 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -1573,7 +1573,7 @@
 >::type
 copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
 {
-    return copy(__first, __first + __n, __result);
+    return _STD::copy(__first, __first + __n, __result);
 }
 
 // move
diff --git a/include/deque b/include/deque
index a704d4e..cb1d147 100644
--- a/include/deque
+++ b/include/deque
@@ -603,7 +603,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 = prev(__r);
+        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
         pointer __rb = *__rp.__m_iter_;
         pointer __re = __rp.__ptr_ + 1;
         difference_type __bs = __re - __rb;
@@ -776,7 +776,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 = prev(__r);
+        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
         pointer __rb = *__rp.__m_iter_;
         pointer __re = __rp.__ptr_ + 1;
         difference_type __bs = __re - __rb;
@@ -1780,7 +1780,7 @@
         {
             const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __b = __base::begin();
-            iterator __bm1 = prev(__b);
+            iterator __bm1 = _STD::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));
@@ -1806,7 +1806,7 @@
         {
             const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __e = __base::end();
-            iterator __em1 = prev(__e);
+            iterator __em1 = _STD::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));
@@ -1842,7 +1842,7 @@
         else
         {
             iterator __b = __base::begin();
-            iterator __bm1 = prev(__b);
+            iterator __bm1 = _STD::prev(__b);
             __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
             --__base::__start_;
             ++__base::size();
@@ -1865,7 +1865,7 @@
         else
         {
             iterator __e = __base::end();
-            iterator __em1 = prev(__e);
+            iterator __em1 = _STD::prev(__e);
             __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
             ++__base::size();
             if (__de > 1)
@@ -1900,7 +1900,7 @@
         else
         {
             iterator __b = __base::begin();
-            iterator __bm1 = prev(__b);
+            iterator __bm1 = _STD::prev(__b);
             __alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
             --__base::__start_;
             ++__base::size();
@@ -1923,7 +1923,7 @@
         else
         {
             iterator __e = __base::end();
-            iterator __em1 = prev(__e);
+            iterator __em1 = _STD::prev(__e);
             __alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
             ++__base::size();
             if (__de > 1)
@@ -2209,7 +2209,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 = min(__back_capacity, __nb);  // don't take more than you need
+    __back_capacity = _STD::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)
@@ -2354,7 +2354,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 = min(__front_capacity, __nb);  // don't take more than you need
+    __front_capacity = _STD::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)
@@ -2608,7 +2608,7 @@
     allocator_type& __a = __base::__alloc();
     if (__pos < (__base::size() - 1) / 2)
     {   // erase from front
-        _STD::move_backward(__b, __p, next(__p));
+        _STD::move_backward(__b, __p, _STD::next(__p));
         __alloc_traits::destroy(__a, _STD::addressof(*__b));
         --__base::size();
         ++__base::__start_;
diff --git a/include/forward_list b/include/forward_list
index 6066475..112e4ce 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -871,7 +871,7 @@
 forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l)
 {
     iterator __i = before_begin();
-    iterator __j = next(__i);
+    iterator __j = _STD::next(__i);
     iterator __e = end();
     for (; __j != __e && __f != __l; ++__i, ++__j, ++__f)
         *__j = *__f;
@@ -886,7 +886,7 @@
 forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
 {
     iterator __i = before_begin();
-    iterator __j = next(__i);
+    iterator __j = _STD::next(__i);
     iterator __e = end();
     for (; __j != __e && __n > 0; --__n, ++__i, ++__j)
         *__j = __v;
@@ -1235,7 +1235,7 @@
                                         forward_list& __x,
                                         const_iterator __i)
 {
-    const_iterator __lm1 = next(__i);
+    const_iterator __lm1 = _STD::next(__i);
     if (__p != __i && __p != __lm1)
     {
         const_cast<__node_pointer>(__i.__ptr_)->__next_ =
@@ -1312,7 +1312,7 @@
     {
         if (__i.__ptr_->__next_->__value_ == __v)
         {
-            iterator __j = next(__i, 2);
+            iterator __j = _STD::next(__i, 2);
             for (; __j != __e && *__j == __v; ++__j)
                 ;
             erase_after(__i, __j);
@@ -1335,7 +1335,7 @@
     {
         if (__pred(__i.__ptr_->__next_->__value_))
         {
-            iterator __j = next(__i, 2);
+            iterator __j = _STD::next(__i, 2);
             for (; __j != __e && __pred(*__j); ++__j)
                 ;
             erase_after(__i, __j);
@@ -1355,7 +1355,7 @@
 {
     for (iterator __i = begin(), __e = end(); __i != __e;)
     {
-        iterator __j = next(__i);
+        iterator __j = _STD::next(__i);
         for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
             ;
         if (__i.__ptr_->__next_ != __j.__ptr_)
@@ -1456,7 +1456,7 @@
     }
     difference_type __sz1 = __sz / 2;
     difference_type __sz2 = __sz - __sz1;
-    __node_pointer __t = next(iterator(__f1), __sz1 - 1).__ptr_;
+    __node_pointer __t = _STD::next(iterator(__f1), __sz1 - 1).__ptr_;
     __node_pointer __f2 = __t->__next_;
     __t->__next_ = nullptr;
     return __merge(__sort(__f1, __sz1, __comp),
diff --git a/include/fstream b/include/fstream
index 809a497..ea9aee6 100644
--- a/include/fstream
+++ b/include/fstream
@@ -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 = min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
+            size_t __nmemb = _STD::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_;
diff --git a/include/istream b/include/istream
index e3bdfb4..90bf4b6 100644
--- a/include/istream
+++ b/include/istream
@@ -1265,7 +1265,7 @@
             case 0:
                 break;
             default:
-                __c = min(__c, __n);
+                __c = _STD::min(__c, __n);
                 for (streamsize __k = 0; __k < __c; ++__k, ++__s, ++__i)
                     *__s = *__i;
             }
diff --git a/include/iterator b/include/iterator
index 8bb811f..ec7a12b 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)
 {
-    advance(__x, __n);
+    _STD::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)
 {
-    advance(__x, -__n);
+    _STD::advance(__x, -__n);
     return __x;
 }
 
diff --git a/include/list b/include/list
index 6c4bc0d..e18dd14 100644
--- a/include/list
+++ b/include/list
@@ -714,8 +714,8 @@
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::__iterator(size_type __n)
 {
-    return __n <= base::__sz() / 2 ? next(begin(), __n)
-                                   : prev(end(), base::__sz() - __n);
+    return __n <= base::__sz() / 2 ? _STD::next(begin(), __n)
+                                   : _STD::prev(end(), base::__sz() - __n);
 }
 
 template <class _Tp, class _Alloc>
@@ -1321,7 +1321,7 @@
 void
 list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
 {
-    if (__p != __i && __p != next(__i))
+    if (__p != __i && __p != _STD::next(__i))
     {
         __node& __f = const_cast<__node&>(*__i.__ptr_);
         base::__unlink_nodes(__f, __f);
@@ -1359,7 +1359,7 @@
     {
         if (*__i == __x)
         {
-            iterator __j = next(__i);
+            iterator __j = _STD::next(__i);
             for (; __j != __e && *__j == __x; ++__j)
                 ;
             __i = erase(__i, __j);
@@ -1378,7 +1378,7 @@
     {
         if (__pred(*__i))
         {
-            iterator __j = next(__i);
+            iterator __j = _STD::next(__i);
             for (; __j != __e && __pred(*__j); ++__j)
                 ;
             __i = erase(__i, __j);
@@ -1403,7 +1403,7 @@
 {
     for (iterator __i = begin(), __e = end(); __i != __e;)
     {
-        iterator __j = next(__i);
+        iterator __j = _STD::next(__i);
         for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
             ;
         if (++__i != __j)
@@ -1435,7 +1435,7 @@
             if (__comp(*__f2, *__f1))
             {
                 size_type __ds = 1;
-                iterator __m2 = next(__f2);
+                iterator __m2 = _STD::next(__f2);
                 for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2, ++__ds)
                     ;
                 base::__sz() += __ds;
@@ -1444,7 +1444,7 @@
                 __node& __l = *__m2.__ptr_->__prev_;
                 __f2 = __m2;
                 base::__unlink_nodes(__f, __l);
-                __m2 = next(__f1);
+                __m2 = _STD::next(__f1);
                 __link_nodes(*__f1.__ptr_, __f, __l);
                 __f1 = __m2;
             }
@@ -1493,12 +1493,12 @@
         return __f1;
     }
     size_type __n2 = __n / 2;
-    iterator __e1 = next(__f1, __n2);
+    iterator __e1 = _STD::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 = next(__f2);
+        iterator __m2 = _STD::next(__f2);
         for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
             ;
         __node& __f = *__f2.__ptr_;
@@ -1506,7 +1506,7 @@
         __r = __f2;
         __e1 = __f2 = __m2;
         base::__unlink_nodes(__f, __l);
-        __m2 = next(__f1);
+        __m2 = _STD::next(__f1);
         __link_nodes(*__f1.__ptr_, __f, __l);
         __f1 = __m2;
     }
@@ -1516,7 +1516,7 @@
     {
         if (__comp(*__f2, *__f1))
         {
-            iterator __m2 = next(__f2);
+            iterator __m2 = _STD::next(__f2);
             for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
                 ;
             __node& __f = *__f2.__ptr_;
@@ -1525,7 +1525,7 @@
                 __e1 = __m2;
             __f2 = __m2;
             base::__unlink_nodes(__f, __l);
-            __m2 = next(__f1);
+            __m2 = _STD::next(__f1);
             __link_nodes(*__f1.__ptr_, __f, __l);
             __f1 = __m2;
         }
diff --git a/include/locale b/include/locale
index b88c6ac..72039a5 100644
--- a/include/locale
+++ b/include/locale
@@ -2580,7 +2580,7 @@
     char_type* __nb = __nar;
     char_type* __ne = __nb + 100;
     __do_put(__nb, __ne, __tm, __fmt, __mod);
-    return copy(__nb, __ne, __s);
+    return _STD::copy(__nb, __ne, __s);
 }
 
 extern template class time_put<char>;
@@ -3248,7 +3248,7 @@
             break;
         case money_base::symbol:
             if (!__sym.empty() && (__flags & ios_base::showbase))
-                __me = copy(__sym.begin(), __sym.end(), __me);
+                __me = _STD::copy(__sym.begin(), __sym.end(), __me);
             break;
         case money_base::value:
             {
@@ -3307,7 +3307,7 @@
     }
     // print rest of sign, if any
     if (__sn.size() > 1)
-        __me = copy(__sn.begin()+1, __sn.end(), __me);
+        __me = _STD::copy(__sn.begin()+1, __sn.end(), __me);
     // set alignment
     if ((__flags & ios_base::adjustfield) == ios_base::left)
         __mi = __me;
@@ -3967,7 +3967,7 @@
             memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
             __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
             __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
-            streamsize __nmemb = min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
+            streamsize __nmemb = _STD::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 6b7bff6..85e10f6 100644
--- a/include/map
+++ b/include/map
@@ -1042,7 +1042,7 @@
     else if (__tree_.value_comp().key_comp()(__hint->first, __k))  // check after
     {
         // *__hint < __k
-        const_iterator __next = next(__hint);
+        const_iterator __next = _STD::next(__hint);
         if (__next == end() || __tree_.value_comp().key_comp()(__k, __next->first))
         {
             // *__hint < __k < *next(__hint)
diff --git a/include/regex b/include/regex
index f851cb1..a791125 100644
--- a/include/regex
+++ b/include/regex
@@ -2228,7 +2228,7 @@
         ++__consumed;
         if (__might_have_digraph_)
         {
-            const _CharT* __next = next(__s.__current_);
+            const _CharT* __next = _STD::next(__s.__current_);
             if (__next != __s.__last_)
             {
                 pair<_CharT, _CharT> __ch2(*__s.__current_, *__next);
@@ -2919,7 +2919,7 @@
             __first = __parse_RE_expression(__first, __last);
             if (__first != __last)
             {
-                _ForwardIterator __temp = next(__first);
+                _ForwardIterator __temp = _STD::next(__first);
                 if (__temp == __last && *__first == '$')
                 {
                     __push_r_anchor();
@@ -3148,7 +3148,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '(')
@@ -3166,7 +3166,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == ')')
@@ -3184,7 +3184,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '{')
@@ -3202,7 +3202,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '}')
@@ -3220,7 +3220,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && '1' <= *__temp && *__temp <= '9')
@@ -3241,7 +3241,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp == __last && *__first == '$')
             return __first;
         // Not called inside a bracket
@@ -3299,7 +3299,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\')
@@ -3330,7 +3330,7 @@
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\')
@@ -3640,7 +3640,7 @@
 {
     if (__first != __last && *__first != ']')
     {
-        _ForwardIterator __temp = next(__first);
+        _ForwardIterator __temp = _STD::next(__first);
         basic_string<_CharT> __start_range;
         if (__temp != __last && *__first == '[')
         {
@@ -3669,7 +3669,7 @@
         }
         if (__first != __last && *__first != ']')
         {
-            __temp = next(__first);
+            __temp = _STD::next(__first);
             if (__temp != __last && *__first == '-' && *__temp != ']')
             {
                 // parse a range
@@ -3891,7 +3891,7 @@
 #endif  // _LIBCPP_NO_EXCEPTIONS
         }
     }
-    __first = next(__temp, 2);
+    __first = _STD::next(__temp, 2);
     return __first;
 }
 
@@ -3920,7 +3920,7 @@
         throw regex_error(regex_constants::error_brack);
 #endif  // _LIBCPP_NO_EXCEPTIONS
     __ml->__add_class(__class_type);
-    __first = next(__temp, 2);
+    __first = _STD::next(__temp, 2);
     return __first;
 }
 
@@ -3953,7 +3953,7 @@
         throw regex_error(regex_constants::error_collate);
 #endif  // _LIBCPP_NO_EXCEPTIONS
     }
-    __first = next(__temp, 2);
+    __first = _STD::next(__temp, 2);
     return __first;
 }
 
@@ -5220,18 +5220,18 @@
         __matches_.resize(__m.size());
         for (size_type __i = 0; __i < __matches_.size(); ++__i)
         {
-            __matches_[__i].first = next(__f, _STD::distance(__mf, __m[__i].first));
-            __matches_[__i].second = next(__f, _STD::distance(__mf, __m[__i].second));
+            __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].matched = __m[__i].matched;
         }
         __unmatched_.first   = __l;
         __unmatched_.second  = __l;
         __unmatched_.matched = false;
-        __prefix_.first = next(__f, _STD::distance(__mf, __m.prefix().first));
-        __prefix_.second = next(__f, _STD::distance(__mf, __m.prefix().second));
+        __prefix_.first = _STD::next(__f, _STD::distance(__mf, __m.prefix().first));
+        __prefix_.second = _STD::next(__f, _STD::distance(__mf, __m.prefix().second));
         __prefix_.matched = __m.prefix().matched;
-        __suffix_.first = next(__f, _STD::distance(__mf, __m.suffix().first));
-        __suffix_.second = next(__f, _STD::distance(__mf, __m.suffix().second));
+        __suffix_.first = _STD::next(__f, _STD::distance(__mf, __m.suffix().first));
+        __suffix_.second = _STD::next(__f, _STD::distance(__mf, __m.suffix().second));
         __suffix_.matched = __m.suffix().matched;
         if (!__no_update_pos)
             __position_start_ = __prefix_.first;
diff --git a/include/sstream b/include/sstream
index ea4cfde..2a5fcc5 100644
--- a/include/sstream
+++ b/include/sstream
@@ -451,7 +451,7 @@
             }
 #endif  // _LIBCPP_NO_EXCEPTIONS
         }
-        __hm_ = max(this->pptr() + 1, __hm_);
+        __hm_ = _STD::max(this->pptr() + 1, __hm_);
         if (__mode_ & ios_base::in)
         {
             char_type* __p = const_cast<char_type*>(__str_.data());
diff --git a/include/vector b/include/vector
index 7c0fc70..f067743 100644
--- a/include/vector
+++ b/include/vector
@@ -1101,7 +1101,7 @@
     if (__n <= capacity())
     {
         size_type __s = size();
-        _STD::fill_n(this->__begin_, min(__n, __s), __u);
+        _STD::fill_n(this->__begin_, _STD::min(__n, __s), __u);
         if (__n > __s)
             __construct_at_end(__n - __s, __u);
         else
diff --git a/src/ios.cpp b/src/ios.cpp
index f506e12..e7153cb 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 = max(2 * __iarray_cap_, req_size);
+            newcap = _STD::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 = max(2 * __parray_cap_, req_size);
+            newcap = _STD::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 = max(2 * __event_cap_, req_size);
+            newcap = _STD::max(2 * __event_cap_, req_size);
         else
             newcap = mx;
         event_callback* fns = (event_callback*)realloc(__fn_, newcap * sizeof(event_callback));
diff --git a/src/regex.cpp b/src/regex.cpp
index 9bc66a5..a29ed73 100644
--- a/src/regex.cpp
+++ b/src/regex.cpp
@@ -229,7 +229,7 @@
 __get_collation_name(const char* s)
 {
     const collationnames* i =
-            lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
+            _STD::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 =
-            lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
+            _STD::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 d0a0ab0..ef12f98 100644
--- a/src/strstream.cpp
+++ b/src/strstream.cpp
@@ -302,7 +302,7 @@
         {
             char* newpos = eback() + newoff;
             if (pos_in)
-                setg(eback(), newpos, max(newpos, egptr()));
+                setg(eback(), newpos, _STD::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, max(newpos, egptr()));
+                    setg(eback(), newpos, _STD::max(newpos, egptr()));
                 if (pos_out)
                 {
                     // min(pbase, newpos), newpos, epptr()
