*char conversion compiler error? | Was: Re: To Walter, about char[] initialization by FF | CHar
Unknown W. Brackets
unknown at simplemachines.org
Sun Jul 30 10:01:03 PDT 2006
Eek! Yes, I would say (in my humble opinion) that this should be a
compile-time error.
Obviously down-casting is more complicated. I think the case of chars
is much more obvious/clear than the case of ints, but then it's also a
special-case.
-[Unknown]
> Unknown W. Brackets wrote:
>>
>> char c = '蝿';
>>
>>
>> Because that would have failed. A char cannot hold such a character,
>> which has a code point outside the range 0 - 127. You would either
>> need to use an array of chars, or etc.
>
> Which, speaking of which, shouldn't that be a compile time error? The
> compiler allows all kinds of *char mingling:
>
> dchar dc = '蝿';
> char sc = dc; // :-(
>
>
More information about the Digitalmars-d
mailing list