Fix std::pair std::is_copy_assignable behavior

François Dumont frs.dumont@gmail.com
Wed Apr 17 19:10:00 GMT 2013


Hi

     Here is an other proposal to fix std::is_copy_assignable<std::pair<>>.

     This is not perfect because I have adapted it to current compiler 
behavior but it is still better than current behavior and enough to 
commit the unordered C++11 allocator adaptation afterward. It will give 
me more time to work on the Standard modification proposal to avoid the 
partial template specialization used for the moment.

     Thanks to current resolution of DR 1402 we can already define the 
move assignment operator as default, if deleted the template move 
assignment operator will be considered and potentially used instead.

2013-04-17  François Dumont <fdumont@gcc.gnu.org>

     * include/bits/stl_pair.h (operator=(const pair&)): Add noexcept
     qualification.
     (operator=(pair&&)): Use default implementation.
     (template<> operator=(const pair&)): Add noexcept
     qualification. Enable if is_assignable<T&, const U&> true for both
     parameter types.
     (template<> operator=(pair<>&&)): Add noexcept
     qualification. Enable if is_assignable<T&, U&&> true for both
     parameter types.
     (std::is_copy_assignable<>, std::is_move_assignable<>): Add
     partial specialization.
     * testsuite/20_util/pair/is_move_assignable.cc: New.
     * testsuite/20_util/pair/is_copy_assignable.cc: Likewise.
     * testsuite/20_util/pair/is_assignable.cc: Likewise.
     * testsuite/20_util/pair/is_nothrow_move_assignable.cc: Likewise.
     * testsuite/20_util/pair/assign_neg.cc: Likewise.
     * testsuite/20_util/pair/is_nothrow_copy_assignable.cc: Likewise.
     * testsuite/20_util/pair/assign.cc: Likewise.

Tested under Linux x86_64.

Ok to commit ?

François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pair.patch
Type: text/x-patch
Size: 21108 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20130417/4a376236/attachment.bin>


More information about the Libstdc++ mailing list