Op 19/09/2016 om 22:49 schreef Thiago Macieira:
In theory, one could perhaps make a second connect to a signal with move
semantics fail, or you could just allow a user to cut himself there,
just like C++ itself does. At least, I am not aware of any mechanism in
C++ itself that would protect against doing a move on the same object
twice. So why should Qt?
On segunda-feira, 19 de setembro de 2016 18:35:43 PDT Etienne Sandré-
Yes, but for instance you can't move-pass an object between signals and
slots across a queued connection, unless I'm wrong. You have to make your
object implicitely shared. This causes lots of copies when passing a
std::vector, for instance.
Correct. You may have more than one slot connected to the same signal, so move
semantics don't make sense to signal-slot connections: if we moved to the first
destination, then the second would receive a moved-from object.
Interest mailing list