|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-08-27 17:31:17
I guess you're right.
3.8/4:
4 A program may end the lifetime of any object by reusing the storage which
the object occupies or by explicitly calling the destructor for an object of
a class type with a non-trivial destructor. For an object of a class type
with a non-trivial destructor, the program is not required to call the
destructor explicitly before the storage which the object occupies is reused
or released; however, if there is no explicit call to the destructor or if a
delete-expression (5.3.5) is not used to release the storage, the destructor
shall not be implicitly called and any program that depends on the side
effects produced by the destructor has undefined behavior.
----- Original Message -----
From: "Valentin Bonnard" <Bonnard.V_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, August 27, 2000 2:27 PM
Subject: Re: [boost] Trivial ctors/dtors
> On Sat, Aug 26, 2000 at 08:06:16PM -0400, David Abrahams wrote:
>
> > I am writing some classes which I plan to allocate out of a special
memory
> > pool, but never destroy (mostly for speed). I am just going to release
the
> > memory pool to clean up. Naturally, these objects must have trivial
> > destructors.
>
> Why ? All you need to know is that the destructor doesn't
> do anything that should be done, like releasing memory
> that isn't allocated in the same pool.
>
> --
>
> Valentin Bonnard
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk