mardi 16 octobre 2018

Moving a unique_ptr in the same statement it is used

Is doing something like this safe? I'm unsure if the execution order is guaranteed or not.

auto foo = std::make_unique<Foo>();
foo->Bar(std::move(foo));

Aucun commentaire:

Enregistrer un commentaire