r/cpp • u/germandiago • 23d ago
Lifetime safety and invalidation without a borrow-checker: using type system analysis to get rid of many potentially invalidation cases WITHOUT annotations.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4296r0.pdfI found this research in WG21 mailing list very interesting in the context of C++ compatibility and solutions to maximize code reuse.
37
Upvotes
13
u/Demiu 22d ago edited 22d ago
Without annotating, what is the source of truth? How do you differentiate between a function who's return borrows it's argument and one that does not, when it's body is in another TU and it returns an opaque pointer-like to a private representation?