3 ms·
s isn't an rvalue. It has a name, and you can refer to it within the body of the constructor.
by plorkyeran 13y ago
s isn't an rvalue. It has a name, and you can refer to it within the body of the constructor.
- a8da6b0c91d 13y agoI understand that, but it's clearly not used in the body. I was hoping it would be a legal and implemented optimization. move calls strike me as ugly and kinda dangerous. What if you do wind up wanting to refer to s in the body later on? It'd be nice if the compiler just handled it.
- marshray 13y ago> What if you do wind up wanting to refer to s in the body later on? Then copy s, don't move it.
- a8da6b0c91d 13y agoThe point is move makes things that look like values as annoying as pointers. You have to keep track.
- marshray 13y agoI'll buy that.