Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-05 05:39:38


"Thorsten Ottosen" <nesotto_at_[hidden]> writes:

> "Dan W." <danw_at_[hidden]> wrote in message
> news:btaalu$flo$1_at_sea.gmane.org...
>
>> I just don't agree that, not
>> having such semantics in existing smart pointers constitutes a violation
>> of constness correctness, or that allowing const functions to call
>> non-const, non-member functions does;
>
> Ok
>
>> for that amounts to saying that
>> the working definition of const-correctness in the language is
>> ill-formed.
>
> AFAIK the language does not on its own have a definition of
> const-cerrectness. I've never seen it mentioned in the
> standard. What is good is that the language allows us to pursue
> const-correctness *if* we want to.

And, define it! I like the definition here:

   http://docs.xbe.ch/arch/dev/cplusplus/part10.html

or here, this one's a bit loose, but it is similar:

   http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.1

I suspect the first one matches most other peoples' definition.
What's your definition?

>> For someone to claim that, she'd have to prove that there
>> is some self-contradiction in it, which I don't think is the case.
>
> The contradiction lies in those who argue const-correctness is good,
> yet don't want it in one of the most important places.

Your argument starts, again, from the position that the status quo for
smart pointers lacks const-correctness. It further presumes an agreement
on what the "important places" for const-correctness are.

> That's inconsistency.

No, that's circularity.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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