Modern C++ Won't Save Us

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Apr 27 20:06:46 UTC 2021


On Monday, 26 April 2021 at 01:28:35 UTC, Walter Bright wrote:
> https://alexgaynor.net/2019/apr/21/modern-c++-wont-save-us/
>
> Lists some perfectly reasonable code in Modern C++ style that 
> has hidden memory safety bugs.

Not at all reasonable to take a borrowing reference from a 
temporary... string_view is not owning.

C++ does not use the compiler to check for memory safety issues. 
Ownership in C++ is a library concept, not a language concept.

C++ is more geared towards using linters for such things. Or 
rather, that is what is being suggested by providing annotations 
for owning/non-wning references.



More information about the Digitalmars-d mailing list