[cfe-dev] Creating New Types

Chris Lattner clattner at apple.com
Tue Aug 7 10:37:51 PDT 2007


>> (This is related to the description of "casting away constness" in
>> the C++ standard [5.2.11p8].)
>
> How so?  const_cast should never change the underlying type (e.g.
> from float to char).  In fact, my understanding of const cast is that
> it isn't a "recursive" process, it just looks at the top-level
> qualifiers and pointer/reference.

Actually, const_cast has to *compare* the src and dest type  
recursively, but I still don't think it has to *reconstruct* a mix of  
the two.

-Chris



More information about the cfe-dev mailing list