[libstdc++ PATCH] Implement __is_nothrow_swappable and use it

Jonathan Wakely jwakely@redhat.com
Fri Jun 5 14:44:00 GMT 2015


On 01/05/15 12:47 +0300, Ville Voutilainen wrote:
>This patch partially solves the problem described in N4426, which is
>basically LWG
>issue 2456, which in turn is caused by CWG DR 1330. Some remarks:
>- the __is_swappable and __is_nothrow_swappable are at this time not
>meant to be general traits, they make the shortcut of automatically transforming
>their template parameter into a reference, which the truly general trait
>as described in N4426 wouldn't do.
>- swap is now constrained..
>- ..which means that everything from bits/move.h moves to type_traits since
>swap now needs type_traits. type_traits becomes ok to include in pre-c++14
>modes, but only enables the parts that work in pre-c++14 modes.
>- this patch does _not_ yet implement N4426.

I've committed this slightly altered patch, which doesn't move swap
into <type_traits> but just declares it there. The definition remains
in <bits/move.h> and including <type_traits> in c++98 mode is still
an error.

Tested powerpc64le-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 15872 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150605/8768fc13/attachment.bin>


More information about the Libstdc++ mailing list