[cfe-commits] [libcxx] r130511 - in /libcxx/trunk/include: __tree deque

Douglas Gregor dgregor at apple.com
Fri Apr 29 09:20:26 PDT 2011


Author: dgregor
Date: Fri Apr 29 11:20:26 2011
New Revision: 130511

URL: http://llvm.org/viewvc/llvm-project?rev=130511&view=rev
Log:
Qualify calls to std::next(), to avoid conflicts with
libraries/applications that define their own 'next' template.

Modified:
    libcxx/trunk/include/__tree
    libcxx/trunk/include/deque

Modified: libcxx/trunk/include/__tree
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__tree?rev=130511&r1=130510&r2=130511&view=diff
==============================================================================
--- libcxx/trunk/include/__tree (original)
+++ libcxx/trunk/include/__tree Fri Apr 29 11:20:26 2011
@@ -1609,7 +1609,7 @@
         const_iterator __next = _STD::next(__hint);
         if (__next == end() || value_comp()(__v, *__next))
         {
-            // *__hint < __v < *next(__hint)
+            // *__hint < __v < *_STD::next(__hint)
             if (__hint.__ptr_->__right_ == nullptr)
             {
                 __parent = const_cast<__node_pointer&>(__hint.__ptr_);

Modified: libcxx/trunk/include/deque
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/deque?rev=130511&r1=130510&r2=130511&view=diff
==============================================================================
--- libcxx/trunk/include/deque (original)
+++ libcxx/trunk/include/deque Fri Apr 29 11:20:26 2011
@@ -1787,7 +1787,7 @@
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = __move_and_check(next(__b), __b + __pos, __b, __vt);
+                __b = __move_and_check(_STD::next(__b), __b + __pos, __b, __vt);
             *__b = *__vt;
         }
     }
@@ -1847,7 +1847,7 @@
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = _STD::move(next(__b), __b + __pos, __b);
+                __b = _STD::move(_STD::next(__b), __b + __pos, __b);
             *__b = _STD::move(__v);
         }
     }
@@ -1905,7 +1905,7 @@
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = _STD::move(next(__b), __b + __pos, __b);
+                __b = _STD::move(_STD::next(__b), __b + __pos, __b);
             *__b = value_type(_STD::forward<_Args>(__args)...);
         }
     }
@@ -2621,7 +2621,7 @@
     }
     else
     {   // erase from back
-        iterator __i = _STD::move(next(__p), __base::end(), __p);
+        iterator __i = _STD::move(_STD::next(__p), __base::end(), __p);
         __alloc_traits::destroy(__a, _STD::addressof(*__i));
         --__base::size();
         if (__back_spare() >= 2 * __base::__block_size)





More information about the cfe-commits mailing list