|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2003-02-18 18:16:54
"Itay Maman" <itay_maman_at_[hidden]> wrote in message
news:20030218225846.29588.qmail_at_web41502.mail.yahoo.com...
"David B. Held" wrote:
> > [...]
> > template <typename T>
> > void operator()(const T& operand) const
> > {
> > operand.~T();
> > }
> > [...]
>
> Is the destructor really a const function?
>
> The object being destroyed is the formal parameter "operand".
> The object whose operator() is called is not changed at all, thus
> the 'const' qualification is in place.
I realize that the operator ought to be const. But should the reference
be? I guess I don't know if you should be able to call a d'tor on a
const& or not.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk