queso
queso copied to clipboard
Deprecate ::Type on smart pointers
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).
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.
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.
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
.