Should you be able to initialize a float with a char?

user1234 user1234 at 12.de
Thu May 19 08:21:54 UTC 2022


On Thursday, 19 May 2022 at 00:27:24 UTC, Walter Bright wrote:
> People routinely manipulate chars as integer types, for 
> example, in converting case. Making them not integer types 
> means lots of casting will become necessary, and overall that's 
> a step backwards.

it is indeed but let's be honest, having builtin char, wchar, and 
dchar, is only usefull for overload resolution and string 
literals.

     ubyte c = 's'; // OK
     ubyte[] a = "s".dup; // NG

without the string literal problem, there's only the overload 
resolution one and for this one builtin character types could be 
library types, e.g struct wrapping ubyte, ushort, uint.


More information about the Digitalmars-d mailing list