Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-03-08 08:40:45


"Alberto Barbati" <abarbati_at_[hidden]> wrote in message
news:c2hhhi$lgs$1_at_sea.gmane.org...
> Thorsten Ottosen wrote:
[snip]
> > The cases where a call to a destructor is actually important beacuse it
does
> > some
> > non-trivial work, one really need
> > to ensure not even temporary objects of the type exists. That's one of
the
> > capabilities my smart containers will allow, ie, "overwriting" really
means
> > destructing and replacing.
>
> I'm sorry, I don't understand what you are trying to say here. I started
> my sentence with "For primitive types"...

yeah, I could have said it better :-) What I meant was that copy-behavior is
ususally
incompatible with non-trivial destructors. What I mean by non-trivial
destructors is that
eg. a file is closed or a connection is closed. In those cases making
temporaries and copies
is not good: you want more explicit control over when the destructor is
called. (hence you need a
container of heap-allocated objects and not something like vector<Socket> )
 For most value-like objects we have the opposite situation and we don't
mind if an object is overwritten by
assignment of if destructors are called.

br

Thorsten


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