9 Nov
2001
9 Nov
'01
6:26 a.m.
I'd like to essentially downcast (to derived) from a base class with virtual methods while preserving (and incrementing) the use_count.. for an upcast, I can simply assign a shared_ptr<Child> to shared_ptr<Parent>. But for the downcast, I need to incorporate a dynamic_cast<childType> to get what I want.. With an older compiler that didn't like member templates, the boost conf would leave the internal pointer and use count as public, so I wrote my own casting function.. However, the newer compiler doesn't give this public access, so I may be stuck without modifying the header... any thoughts?