Title
N3746, N3553 Proposing a C++1Y Swap Operator
Status
nad
Section
[over.oper]
Submitter
Walter Brown

Created on 2013-03-13.00:00:00 last changed 135 months ago

Messages

Date: 2013-10-11.23:34:25

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3746.pdf

http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3553.pdf

Bristol 2013:

Point d in "the basics": left operand is a modifiable lvalue expression and the right operand a modifiable glvalue. Why the asymmetry? JC: it's because the operator returns the lhs.

Bjarne: do we really need a new operator?

Matt: Maybe. swap() has annoying ADL problems.

Daveed: does it really solve them? The operator will still be found by ADL. Matt: maybe, since this would use an intrinsic in place of the general std::swap template.

Bjarne: But swap() isn't going away because of backward compatibility, so now we'll have swap() and operator:=:. "Probably a good idea if we had a time machine". Introducing a new operator, it has to be really central and helpful. If it got us out of our swap problem it might be good enough, but it isn't. Libraries aren't going to stop calling swap and if they did then all the specialized swap functions people have written wouldn't get invoked. Problems are real, but the benefits it would have (i.e. what problem it would actually solve) aren't sufficiently explained. Too likely that swap and :=: would coexist indefinitely and that all the problems of swap would persist.

General agreement that this is a real problem but that it's not clear why this would solve them. We will not proceed with this.

No recommendation to move forward, considered NAD.

History
Date User Action Args
2013-03-13 00:00:00admincreate