|
Boost : |
From: Thomas Matelich (sosedada_at_[hidden])
Date: 2000-05-31 08:36:49
Kevlin Henney wrote:
> In message <802568EF.00713157.00_at_[hidden]>, Jon Jagger
> <jon.jagger_at_[hidden]> writes
> >Hi,
> >I'm sure it's just me not knowing some obscure corner of C++, but what is a
> >mutable reference?
> >
>
>
> It's illegal, which saves having to dream up an interpretation for it
> :->
I've been waiting and waiting for some genius to explain this, so I'll have a
stab at it. Mutable has nothing to do with what data type it modifies, mutable
means that if the object is being accessed via a pointer-to-const, the mutable
member may be modified. Note that a const member function basically says that
"this" is now a pointer-to-const for the const function. More in depth
analysis at:
http://www.cerfnet.com/~mpcline/c++-faq-lite/const-correctness.html#[18.10]
-- Thomas O Matelich Senior Software Designer Zetec, Inc. sosedada_at_[hidden] tmatelich_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk