This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [v3] Fix move assignment operators vs self assignment


Paolo Carlini wrote:

Hi,

a serious oversight, sorry. Tested x86_64-linux, committed to
mainline.

Paolo.

/////////////////

I believe this might not be a serious oversight at all, but rather an early implementation of the resolution to Library Issue #1204.


http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1204

where it says:

"Additionally this clarifies that move assignment operators need not perform the traditional if (this != &rhs) test commonly found (and needed) in copy assignment operators."


The only way to get a move self assignment is to use x = std::move(x). If you actually do that, the library might not be required to save you.




Bo Persson


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