I’m a long time user of the boost::smart_ptr library and love it. Like all boost libraries it is design to work well with the C++ Standard Library. Which usually is a great thing.
Unfortunately, I’m facing a situation were I need to be completely independent of the standard library. Despite this I would need the same kind of functionality as that offered by the boost::smart_ptr (except, obviously every thing that has to do with std::). This includes amongst others, retain count, overloading of the bool and -> operators, relationships between week_ptr and shared_ptr etc.
Has anyone been faced with this situation? I’m looking into using the boost::smart_ptr as a starting point and replacing/eliminating std:: related things. But looking at the complexity, am increasingly concerned about breaking things.
The Loki library may help you, it has a SmartPtr class. It uses std (std::swap, std::runtime_error), but it does not seem to be too hard to get rid of it.