The way I see it, profiles are mainly targeting "low hanging fruits" to achieve partial safety in old or new code, while dancing around the main problem of lifetimes/mutability. Meanwhile, safecpp tackles safety comprehensively in new code making some hard (unpopular?) choices, but doesn't address hardening of old code.
After listening to Herb Sutter's talks on safety and Cpp2 I think this is exactly what he believes is better for C++, yes.
but also doesn't cpp2 add more information and 'viral annotations' to cpp2? cpp2 has ininoutout for references, and copymove and forward which basically shows that cpp doesn't have enough information in the language to achieve even the safety that cpp2 is trying to achieve in it's limited set of improvements.
IMO cpp2 is tackling slightly higher-hanging fruit with those keywords. Personally I love the out keyword in C# and I hope C++ gets it, and the others.
These annotation are local to the function (thus not viral) and except for `out` correspond directly to the normal cpp function parameter declarations.
View all comments
Show parent comment
29
u/equeim Oct 25 '24 edited Oct 25 '24
After listening to Herb Sutter's talks on safety and Cpp2 I think this is exactly what he believes is better for C++, yes.