From: Fredrik Blomqvist (fredrik_blomqvist_at_[hidden])
Date: 2003-04-16 12:14:10
Reece Dunn wrote:
> If I understand the ISO/IEC C++98 standard correctly:
>  const T & ref;
> means that the data type referred to by ref is constant (i.e. you
> cannot modify its internal state).
>  T & const ref;
> means that the *reference* is constant.
>  const T & const ref;
> both reference and data type are constant.
This should answer most of your questions.
(Most importantly  and  are Not the same.)
Also see the 18.104.22.168 paragraph in the standard why  is incorrect.
The const issue is also discussed in for example EC++ item 21.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk