This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [C++ dayly bug report] const_cast to rvalue of class type


patrick <patrick@mail.boxsoft.com> writes:

| Sometime in the late 1900s it was said:
| 
| OK.  I may be in the dark here too.  But afaik const_cast<T>( t )
| will cast t to T exactly as  (T)t  would have iff T and the type
| of t are different either in 'const' and 'volatile'.  At least that
| is what Bjarne Stroustrup confirms (as I paraphrased from his book).

Exact citation please.

| Am I wrong?

Please check 5.2.11/*. Your assertion is valid only iff T is a reference
type or a pointer type, as I said earlier.

-- Gaby