queso icon indicating copy to clipboard operation
queso copied to clipboard

Deprecate ::Type on smart pointers

Open roystgnr opened this issue 9 years ago • 3 comments

After discussing my thought on #398 with Damon: we should have ScopedPtr and SharedPtr inherit from their underlying pointers (to allow code to be written using those types without ::Type suffixes) but also leave the nested typedefs in place (to allow older code to continue to work unchanged).

roystgnr avatar Aug 31 '15 21:08 roystgnr

No idea how we'd alert users to the deprecation, though. Compile-time warnings are great; run-time warnings are okay; hoping-the-users-reread-header-comments is nearly worthless.

roystgnr avatar Aug 31 '15 21:08 roystgnr

std::shared_ptr and boost::shared_ptr don't have virtual destructors. This is fine if our objects won't be treated polymorphically, but I don't think we can trust clients not to treat our objects polymorphically.

dmcdougall avatar Apr 19 '17 18:04 dmcdougall

Another approach to deprecating ::Type is through composition, but that would require more code on our part.

Honestly, once we're in the situation where we require C++11, we should just deprecate this entirely and switch to std::unique_ptr and std::shared_ptr.

dmcdougall avatar Apr 19 '17 18:04 dmcdougall