This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ dayly bug report] const_cast to rvalue of class type
- To: patrick <patrick at mail dot boxsoft dot com>
- Subject: Re: [C++ dayly bug report] const_cast to rvalue of class type
- From: Gabriel Dos_Reis <Gabriel dot Dos_Reis at sophia dot inria dot fr>
- Date: 30 Apr 1999 05:03:29 +0200
- Cc: scherrey at proteus-tech dot com, egcs at egcs dot cygnus dot com (egcs list), egcs-bugs at egcs dot cygnus dot com
- Organization: I.N.R.I.A Sophia-Antipolis (France)
- References: <199904300250.TAA12445@3eye.boxsoft.com>
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