3 ms·
I disagree. “unique_ptr” and “shared_ptr” both model very simple ownership policies, yet there is still value in separating them from the objects whose lifetime
by evincarofautumn 14y ago
I disagree. “unique_ptr” and “shared_ptr” both model very simple ownership policies, yet there is still value in separating them from the objects whose lifetimes they manage. The value is in their composability—a programmer can rely on “unique_ptr” to do the right thing automatically, in a manner enforced by the type system. When writing C++ code, I spend an irritating proportion of my time navigating the minefield—it’s well worthwhile to encapsulate some of those details.