4 ms·
Or use a C++ linter that disallows raw pointers, non-const references etc. There’s more, but, it’s mostly a subset of the language, although I admit some common
by jl2718 3y ago
Or use a C++ linter that disallows raw pointers, non-const references etc. There’s more, but, it’s mostly a subset of the language, although I admit some common syntax can get bloated this way.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2739r0.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p27...
- UncleMeat 3y agoIt's a lot more than that. You can have a use after free by taking a const reference to a stack allocated value and returning it. You can happily have buffer overruns on data structures like std::vector. You can have use after frees through misuse of smart pointers. You can have all sorts of fun problems through invalid casts. The rules to actually subset c++ in a way that is safe by construction are actually way more harsh than commonly presented and Bjarne's proposal is, in my opinion, nowhere near strong enough to actually achieve it.