3 ms·
> But then there is the idea of ignoring legacy C++ and treating Modern C++ as a new language altogether. There is no "ignoring legacy C++", when you will have
by throwsincenotpc 10y ago
> But then there is the idea of ignoring legacy C++ and treating Modern C++ as a new language altogether.
There is no "ignoring legacy C++", when you will have to deal with this or that library written 10/15 years ago. C++ is a language where you can't just ignore some parts of it just because they are inconvenient.
As for C++ vs Rust, Rust is memory safe, C++ is not and will never be despite all the bells and whistles it gets.
- ar15saveslives 10y agoWhat is "memory safe" for you? If you use C arrays and raw pointers in your C++17 code, it's definitely not memory safe, but the main problem is that it's not modern C++.
- steveklabnik 10y agoEven modern C++ isn't memory safe. Most straightforward example is to move a uniq_ptr, which makes it a nullptr, ready to be dereferenced and cause UB.
- ar15saveslives 10y agoHow does it happen? Non-const unique_ptr& used as a function parameter?
- steveklabnik 10y agohttp://www.steveklabnik.com/uniq_ptr_problem/ http://www.steveklabnik.com/uniq_ptr_problem/
- ar15saveslives 10y agoI can simplify your example: unique_ptr<int> p; auto n = *p; // C++ kills!