|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-07-16 01:01:01
"Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
news:ah005q$b1s$1_at_main.gmane.org...
> [...]
> mutable_ptr<>:
Is the LGPL compatible with Boost licensing requirements? I'm not sure.
Some people say leading underscore names are not recommended,
because they tend to be close to reserved names. I'm no expert on smart
pointers, but it seems that std::auto_ptr could easily have taken this
route. My question is: why did it not?
> [...]
> shared_ptr<>:
> - functionality is similar to boost::shared_ptr<> except:
Actually, it's not remotely like boost::shared_ptr<>. It doesn't support
custom deleters or void pointers. It doesn't work with weak or intrusive
pointers. And it doesn't provide operator! or a bool test operator. It
also doesn't interoperate with std::auto_ptr or boost::scoped_ptr.
> - reference counters are merged with instanciated objects:
> - operator new () is called once in the end (like
> boost::shared_ptr<>);
Except that you call a copy c'tor, which prevents you from using the
class with non_copyable objects, and imposes a penalty on expensive-
copy types. And the construction syntax is awkward.
> - the pointer is same size as sizeof(void *);
So is boost::intrusive_ptr, if I recall correctly.
> - reference counters are not copied when assignments are
called;
> - little drawback: assignments work only with other
> fdi::shared_ptr<>
> - the only change from std::auto_ptr<> interface was that release()
was
> renamed to share();
> - faster than boost::shared_ptr<>.
But only because it has a small subset of boost::shared_ptr's functionality
and flexibility.
> I hope someone will share the same vision of efficienty benefits I have.
I think there are certainly cases where efficiency is important. However,
most people agree that the proliferation of smart pointer types is a
problem.
Getting people to toss another one in their toolbox might be a challenge. ;)
Also, you have a name clash. I don't think the current boost::shared_ptr
is going to get deprecated in favor of your design. ;)
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk