I’m author of “PImpl, Rule of Zero and Scott Meyers”.
impl_ptr described in mine article (https://github.com/oliora/samples/blob/master/spimpl.h) has the same behavior as
value_ptr (owning of heap allocated object and cloning it on copy) and can be used instead of
impl_ptr. Despite of the same behavior, I think that concept of
value_ptr is more universal (thus better) than one of
impl_ptr. The name is better as well!
That’s why it would be great if
value_ptr get a solid implementation that is on par with a great idea behind it. If you allow, I’d like to propose the following changes to
compressed_pair<unique_ptr<T>, Cloner>instead of two separate members to save some space in case of stateless cloner.
- Look at
impl_ptrinterface and steal it to make
value_ptrsafer and more like an STL smart pointers.
- Allow to specialize Deleter (take a look at
All the best!