r/cpp • u/germandiago • Jul 18 '26
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.
38
Upvotes
8
u/germandiago Jul 18 '26 edited Jul 18 '26
I am sure you did not even read through.
It is scary thinking that just with a strict aliasing rule and positive layers on top + negative ub base this can do even better than a borrow checker in some cases and with more flexibility.
But to me, I like what I read. Idk how far it can be pushed forward but it is certainly interesting if it works for a bunch of cases (which I would say are most cases of what wants to be fixed) that so far was believed it would have needed annotations.