libqueso / queso

QUESO is a C++ library for doing uncertainty quantification. QUESO stands for Quantification of Uncertainty for Estimation, Simulation and Optimization.
Other
58 stars 39 forks source link

Deprecate ::Type on smart pointers #400

Open roystgnr opened 9 years ago

roystgnr commented 9 years ago

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 commented 9 years ago

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.

dmcdougall commented 7 years ago

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 commented 7 years ago

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.