This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/52745] GCC4.7 vector uses copy instead of move constructor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52745

--- Comment #4 from Jonathan Rogers <J.W.Rogers+gcc at gmail dot com> 2012-03-27 23:25:45 UTC ---
(In reply to comment #3)
> Otherwise, if the move constructor by chance throws, the push_back cannot have
> no effects, as required by 23.2.1/10. Actually the requirement holds for all
> the containers, but only std::vector implements it in 4.7, the other containers
> (I *think* only std::deque needs work) will follow.

In my example code, if you comment out the copy constructor (leaving only the
move constructor) then vector will use the (potentially throwing) move
constructor.

If what you say is the case, shouldn't vector refuse to use the move
constructor?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]