Burnhard, your way of doing things buys you nothing but causes quite a few problems. My main issue is this though; if you are willing to sacrifice performance and flexibility to such a large degree in a bid to remove leaks, why are you using C++ instead of a garbage collected language?
THROWIFNULL(MyBar); // Not entirely unreasonable to check this, is it?
Yes it is. It means that member functions cannot be no-throw - which is a bit of a problem if you want your code to provide the strong exception guarantee.
Quote:My code contains no destructors (virtual or otherwise), no use of "delete" or "release" or "addref" at all and no use of "new" outside of factory CreateXXXX functions. These are things I see sprinkled around tutorial, sample and example code all of the time. I have a feeling they're used in a lot of production code too. As they're points of failure, I think it's not unreasonable to go the extra mile to develop methods that manage them more robustly.
I think boost/std::tr1::shared_ptr manages that robustly - I think the way you're using them introduces extra complexity / adds maintainance cost for no benefit.
I'm curious - are you using this in a team setting, or are you doing solo development?