vector (insert(iterator, _Tp&&), [...]): Enable only when _Tp != bool.
authorPaolo Carlini <paolo@gcc.gnu.org>
Fri, 18 Jul 2008 20:11:21 +0000 (20:11 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 18 Jul 2008 20:11:21 +0000 (20:11 +0000)
2008-07-16  Paolo Carlini  <paolo.carlini@oracle.com>

* include/debug/vector (insert(iterator, _Tp&&), push_back(_Tp&&)):
Enable only when _Tp != bool.

* testsuite/25_algorithms/heap/1.cc: Avoid unused variable warnings.

From-SVN: r137962

libstdc++-v3/include/debug/vector
libstdc++-v3/testsuite/25_algorithms/heap/1.cc

index 12bd52f0b2bf6f07af2b1e4a5e894766de6f1266..f0c63a6ad7696c65b866443901458ff509070676 100644 (file)
@@ -300,9 +300,11 @@ namespace __debug
       }
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
-      void
-      push_back(_Tp&& __x)
-      { emplace_back(std::move(__x)); }
+      template<typename _Up = _Tp>
+        typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
+                                       void>::__type
+        push_back(_Tp&& __x)
+       { emplace_back(std::move(__x)); }
 
       template<typename... _Args>
         void
@@ -360,9 +362,11 @@ namespace __debug
       }
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
-      iterator
-      insert(iterator __position, _Tp&& __x)
-      { return emplace(__position, std::move(__x)); }
+      template<typename _Up = _Tp>
+        typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
+                                       iterator>::__type
+        insert(iterator __position, _Tp&& __x)
+        { return emplace(__position, std::move(__x)); }
 #endif
 
       void
index 571a2936ed2cdd2871b16e3d52d386b0239573ba..4032ca82e326fc3779708fd96a25073ce090407e 100644 (file)
@@ -89,8 +89,10 @@ test02()
 
   Gt gt;
 
+#ifndef _GLIBCXX_DEBUG
   //const int logN = static_cast<int>(std::log(static_cast<double>(N)) + 0.5);
   const int logN = 3;
+#endif
   
   int s1[N];
   std::copy(A, A + N, s1);