diff mbox

[v3] Small tweak to std::move_if_noexcept

Message ID 4DED0533.4060505@oracle.com
State New
Headers show

Commit Message

Paolo Carlini June 6, 2011, 4:49 p.m. UTC
Hi,

noticed while working on std::vector. Tested x86_64-linux, committed.

Paolo.

///////////////////
2011-06-06  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/move.h (move_if_noexcept): Use __and_ and __not_.
diff mbox

Patch

Index: include/bits/move.h
===================================================================
--- include/bits/move.h	(revision 174699)
+++ include/bits/move.h	(working copy)
@@ -90,8 +90,8 @@ 
    */
   template<typename _Tp>
     inline typename
-    conditional<(!is_nothrow_move_constructible<_Tp>::value
-		 && is_copy_constructible<_Tp>::value),
+    conditional<__and_<__not_<is_nothrow_move_constructible<_Tp>>,
+                       is_copy_constructible<_Tp>>::value,
                 const _Tp&, _Tp&&>::type
     move_if_noexcept(_Tp& __x) noexcept
     { return std::move(__x); }