std::pair copy and move constructor

François Dumont
Fri Feb 15 20:55:00 GMT 2013


     I had a problem with the result of 
std::is_copy_assignable<std::pair<const int, int>>::type which used to 
be true_type. So here is a patch to fix that.

2013-02-15  François Dumont  <>

     * include/bits/stl_pair.h (pair): Use default implementation for
     copy and move constructors.
     * testsuite/20_util/pair/ New.
     * testsuite/20_util/pair/ New.

     I kept some checks commented. For is looks 
like DeletedMoveAssignClass has also its copy assignment operator 
deleted. In even when pair is only composed of 
DeletedMoveAssignClass it looks like the pair still have a move 
assignment operator.

     I was surprised to see that those operator were not already using 
the default implementation so sorry if I miss the mails explaining why.

     Tested under Linux x86_64.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pair.patch
Type: text/x-patch
Size: 5733 bytes
Desc: not available
URL: <>

More information about the Gcc-patches mailing list