Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S...
by muizelaar on Friday January 24, 2020 @02:44PM
(#22141748)
Is there a document that describes roughly how to do the conversion? How are things like pointer arithmetic handled?
[ Parent
| on HN ]
Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S...
by safercplusplus on Friday January 24, 2020 @08:09PM
(#22143946)
Unfortunately, documentation [1] is still kind of lacking. Like Rust (and arguably modern C++ conventions?), the safe subset doesn't support pointer arithmetic directly. You would have to convert the pointer to an iterator (and its target to an appropriate container).
Auto-conversion of code that uses pointer arithmetic is challenging, but has been demonstrated to be solvable in the general case [2].
[1] https://github.com/duneroadrunner/SaferCPlusPlus#getting-sta...
[2] https://github.com/duneroadrunner/SaferCPlusPlus-AutoTransla...