This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] libstdc++/58357 change std::rotate to std::_V2::rotate

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

Tested x86_64-linux, committed to trunk.

commit 6e11ededb0167d9fb94152bba3f9e94234b77f4d
Author: Jonathan Wakely <>
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
     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>
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
       return __m;
+  inline namespace _V2
+  {
   /// This is a helper function for the rotate algorithm.
   template<typename _ForwardIterator>
+  } // namespace _V2
    *  @brief Copy a sequence, rotating its elements.
    *  @ingroup mutating_algorithms

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]