dimanche 4 novembre 2018

How do I know if object passed as r-value will get moved?

I'm passing a lambda to a function. The function is taking it as a r-value reference. If my lambda is defined in the function call itself, I don't really care what happens to it later. But if my lambda is a variable (say I want to use it more than once) I do want to know that it is jot moved-from. Is there a way to know will it be moved-from or not, making unusable or usable accordingly after the call has returned?

Aucun commentaire:

Enregistrer un commentaire