diff mbox

libstdc++/58357 change std::rotate to std::_V2::rotate

Message ID 20150219205742.GQ3360@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Feb. 19, 2015, 8:57 p.m. UTC
DR 488 changed std:rotate to return an iterator, implemented on trunk
in r219793. To avoid problems where code expecting a non-void return
links to an instantiation of the old void-returning definition I'm
putting the new definition in the inline namespace _V2 (already used
for other entities that have changed, such as
std::condition_variable_any).

Tested x86_64-linux, committed to trunk.
diff mbox

Patch

commit 6e11ededb0167d9fb94152bba3f9e94234b77f4d
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Jan 17 14:03:46 2015 +0000

    	PR libstdc++/58357
    	* include/bits/algorithmfwd.h (rotate): Move to inline namespace _V2.
    	* include/bits/stl_algo.h (__rotate, rotate): Likewise.

diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h
index 11361bb..1dfc4ad 100644
--- a/libstdc++-v3/include/bits/algorithmfwd.h
+++ b/libstdc++-v3/include/bits/algorithmfwd.h
@@ -530,9 +530,12 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
     _OIter 
     reverse_copy(_BIter, _BIter, _OIter);
 
-  template<typename _FIter>
-    _FIter
-    rotate(_FIter, _FIter, _FIter);
+  inline namespace _V2
+  {
+    template<typename _FIter>
+      _FIter
+      rotate(_FIter, _FIter, _FIter);
+  }
 
   template<typename _FIter, typename _OIter>
     _OIter 
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index c27c092..53c455b 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -1237,6 +1237,9 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return __m;
     }
 
+  inline namespace _V2
+  {
+
   /// This is a helper function for the rotate algorithm.
   template<typename _ForwardIterator>
     _ForwardIterator
@@ -1438,6 +1441,8 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			   std::__iterator_category(__first));
     }
 
+  } // namespace _V2
+
   /**
    *  @brief Copy a sequence, rotating its elements.
    *  @ingroup mutating_algorithms