Boost logo

Boost :

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:
> [1] const T & ref;
> means that the data type referred to by ref is constant (i.e. you
> cannot modify its internal state).
> [2] T & const ref;
> means that the *reference* is constant.
> [3] const T & const ref;
> both reference and data type are constant.

This should answer most of your questions.
(Most importantly [1] and [2] are Not the same.)

Also see the paragraph in the standard why [2] is incorrect.

The const issue is also discussed in for example EC++ item 21.


Boost list run by bdawes at, gregod at, cpdaniel at, john at