2 ms·
Sure but that is already a risk in C++ at the moment. void foo() { if (true) { Foo f; stores_a_reference_to_foo(&f); }
by quietbritishjim 4y ago
Sure but that is already a risk in C++ at the moment.
void foo() {
if (true) {
Foo f;
stores_a_reference_to_foo(&f);
}
uses_stored_reference_to_foo();
}
I see that destructive moves would in theory introduce more opportunities for that, but I don't really see it making a big difference in practice - routines that take a pointer/reference and hold onto them (without taking ownership) already need a lot of care in C++.