Failing test when run as C++11

Jonathan Wakely jwakely@redhat.com
Fri May 9 10:53:00 GMT 2014


20_util/specialized_algorithms/uninitialized_copy/808590.cc fails if
run in C++11 mode because is_nothrow_move_constructible<c> is false,
which means vector::resize() copies the elements using non-const
lvalue arguments, which selects the template constructor.

(In C++03 it copies from *const* lvalue arguments, selecting the copy
constructor.)

We can either fix it by adding throw() to the copy constructor, or by
adding a move cosntructor (with a comment explaining why):

#if __cplusplus >= 201103L
   c(c&&) = default;
#endif

I can't decide which I prefer, does anyone else have a preference?



More information about the Libstdc++ mailing list