
8 Jan
2013
8 Jan
'13
5:53 p.m.
Philipp Moeller wrote:
The only situation, I am aware of, where a value is still accessible after being moved is when it is forcibly converted to an T&& through std::move or a cast ("explictliy specified" in 12.8), so this shouldn't be permissible for some types. ... I think this is a defect of the standard library definition because you really want to implement some types that way and it should be possible to do it.
No, you really don't want to implement a type this way. It would break* the default implementation of std::swap and most of the rest of the standard library. Moving from lvalues is an important use case. * Where "break" is a shorthand for "reduce performance significantly".