From: David B. Held (dheld_at_[hidden])
Date: 2004-01-03 15:36:06
"Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
> :-) it depends on one's definition of const-correctness. I'm talking
> about *propagation of constness* within const member functions,
> not unconditional constness.
> This is the only meaning of const-correctness that I have seen.
I've never seen "propagation of constness" mentioned in any
definition of "const correctness". Sometimes a const member
function will only call const functions, and sometimes it won't.
I think you're misled by the fact that a const member function
can only call other const *member functions*. But there is nothing
intrinsically wrong with a const member function calling a non-
const free function. Anyway, I don't see what your problem is
with the smart_ptr<T const> syntax. It causes operator->() to
return a T const*, which is just what you want, right? And you
can create a smart_ptr<T const> from a smart_ptr<T>, just like
you can create a T const* from a T*. So, *if* you can do what
you think is the Right Thing(TM), then why does it matter that
you can also do things another way, which you might think is
not the Right Thing(TM)?
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/2003
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk