Boost logo

Boost :

From: Joe Gottman (jgottman_at_[hidden])
Date: 2003-05-13 18:32:39


"Csaba Szepesvari" <cszepes_at_[hidden]> wrote in message
news:20030513085909.31576.qmail_at_web40608.mail.yahoo.com...
> Hi!
>
> I've created a folder strong_ptr in boost/files and uploaded some files
> implementing a smart pointer with copy semantics supporting polymorphic
copy
> when used with cloneable objects (a proposed class to support cloneing)
along
> with an example.
> Question if there is any interest in such an artifact.
>
> The typical usage is:
> - as a member of a composite class that needs to manage a polymorphic
object
> - supporting the implementation of the pimpl idiom
>
> In the former case strong_ptr frees the user of the burdon of having to
write
> custom destructors/copy constructors/.. and hence encourages a good
practice..
>
> IMHO strong_ptr complements nicely shared_ptr and scoped_ptr.

   Looks nice, but you might want to change the name. New users might
assume that strong_ptr has something to do with weak_ptr, and get confused
when it doesn't. Also, if you are giving const and non-const versions of
operator *() and operator->(), shouldn't you do the same thing for get()?

Joe Gottman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk