I'd like to prevent clients from directly creating and deleting instances of
a type like 'Bill' below, so Bill's constructor and destructor have been
made private to prevent ordinary client access. Since Bill has reference
semantics, construction is handled by a static 'Bill::create()' factory
method which returns a dynamically allocated Bill instance wrapped in a
shared_ptr. Destruction is handled by a private Bill::Deallocator who also
happens to be a Friend of Bill (FOB).
My question is: Is this an acceptable use of the shared_ptr deallocator, or
am I just asking for trouble?
Thanks,
Greg Hickman
//--------------------------------------
#include