Remix.run Logo
pornel an hour ago

BTW, Rust's lifetime annotations for borrowed references are a mostly orthogonal feature.

Liveness of objects for move/drop semantics is tracked differently, without any syntax and with implicit runtime drop flags where necessary.

C++ could probably add the same deinitialized/moved-from state tracking (with an opt-in for back compat sake) purely to avoid dtor bloat, without having to add safety of borrow checking.

bluGill 41 minutes ago | parent [-]

> C++ could probably add the same deinitialized/moved-from state (with an opt-in for back compat sake) purely to avoid dtor bloat, without having to add safety of borrow checking.

There is a lot of talk in the C++ committee about this. The details are complex in some obscure cases.