4 ms·
Knowing who owns an object is a solved problem in C++, most codebases I've seen use unique_ptr. Rust isn't the only language with ownership.
by moldavi 6y ago
Knowing who owns an object is a solved problem in C++, most codebases I've seen use unique_ptr. Rust isn't the only language with ownership.
- IshKebab 6y ago> a solved problem Quite an exaggeration. I've never seen a C++ codebase that doesn't resort to bare references or pointers at some point. None of them exclusively use unique_ptr and shared_ptr.
- moldavi 6y agoRaw pointers and raw references are non-owning, shared_ptr and unique_ptr are owning. Ownership is solved in modern C++.