Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-08-27 13:02:00


----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>

> David Abrahams wrote on 8/27/2000 10:20 AM
> >Sorry, I meant std::pair<int, int>. What I meant to wonder about was
whether
> >the standard gives implementors the leeway to write:
> >
> >~pair {} // non-trivial dtor
> >
> >in the declaration of pair<>.
> >
> >That is non-trivial, strictly speaking, right?
>
> Good question. According to 12.4/3 it is non-trivial. But according to
> 17.3.2.2/1 it would have the same semantics as an implementation that
> provided the trivial (compiler-generated) version.
>
> At this point we probably get into word games...
>
> Bottom line is ~pair<int, int> doesn't (or shouldn't) do anything, no
> matter how it is implemented.

But the real question, strictly speaking, is: is it OK to deallcate the
memory for a pair<int, int> without destroying the pair first?

-Dave


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