The main reason that scoped_ptr doesn't provide this feature is that nobody made a convincing case for it.
(An example of a convincing case: "In my project I have encountered the following situation:
and I believe that scoped_ptr would be a perfect fit." Some non-examples: "Someone might find it useful." "Wouldn't it be cool if...") I suspect that most people just use editor inheritance or specialize ~scoped_ptr.
I am now working on a project, where I use scoped_ptr and shared_ptr.
shared_ptr works well on most tasks, but I often need to instantiate
Xerces classes, which are used only locally, and must be release()-d
at the end of the procedure.
I wrote a custom_auto_ptr
No. auto_ptr
would indeed be useful, but many compilers can't handle the machinery that is needed to build an auto_ptr, which is probably why there are few auto_ptr reimplementations and enhancements around.
Hmmm. shared_ptr and scoped_ptr (and my custom_auto_ptr) work flawlessly on HP-UX aCC. Do you know a compiler which is even more worse than that? :-)