|
Boost : |
From: Lucas Galfaso (lgalfaso_at_[hidden])
Date: 2003-04-16 11:39:17
"Kevlin Henney" <kevlin_at_[hidden]> wrote in message
news:02DZoaAh3Xn+Ewtg_at_curbralan.com...
> In article <BAY7-F60sAuwsd1C5vK00008129_at_[hidden]>, Reece Dunn
> <msclrhd_at_[hidden]> writes
> >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).
>
> To be precise, you cannot modify the object referred to by ref via ref:
> it may be a non-const object, in which case it could change, just not
> via the ref.
>
> >[2] T & const ref;
> >means that the *reference* is constant.
> >
> >[3] const T & const ref;
> >both reference and data type are constant.
>
> The fundamental difference is that [1] is legal and both [2] and [3] are
> illegal: you cannot cv-qualify a reference.
Not exactly
[2] IS legal as is equivalent to [1]
>
> Kevlin
> ____________________________________________________________
>
> Kevlin Henney phone: +44 117 942 2990
> mailto:kevlin_at_[hidden] mobile: +44 7801 073 508
> http://www.curbralan.com fax: +44 870 052 2289
> Curbralan: Consultancy + Training + Development + Review
> ____________________________________________________________
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk