From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-03-08 08:40:45
"Alberto Barbati" <abarbati_at_[hidden]> wrote in message
> Thorsten Ottosen wrote:
> > The cases where a call to a destructor is actually important beacuse it
> > some
> > non-trivial work, one really need
> > to ensure not even temporary objects of the type exists. That's one of
> > capabilities my smart containers will allow, ie, "overwriting" really
> > 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
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk