Boost logo

Boost :

From: Itay Maman (itay_maman_at_[hidden])
Date: 2003-02-20 03:35:17


"David B. Held" <dheld_at_[hidden]> wrote in message
news:b2ug4i$a8q$1_at_main.gmane.org...
> "Eric Friedman" <ebf_at_[hidden]> wrote in message
> news:b2uflv$86s$1_at_main.gmane.org...
> > [...]
> > const T& r = ...;
> > r.~T();
> >
> > Even if my understanding is correct though, it may be best for destroyer
> > to take a non-const reference to avoid confusion.
>
> Comeau says it's ok, so I'd just leave it as is. It does seem peculiar to
> me, though.
>
> Dave
>

I was surprised to read that, but the standard says it is Kosher:

[12.4.2]

"...A destructor can be invoked for a const, volatile or const
volatile object. A destructor shall not be declared const, volatile or
const volatile (_class.this_). const and volatile semantics
(_dcl.type.cv_) are not applied on an object under destruction."

--
Itay Maman
    itay_maman@_yahoo_.com
    maman_at_il._ibm_.com
[The above message expresses my personal views].



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