dchar literals?

Kenji Hara k.hara.pg at gmail.com
Tue Nov 12 00:14:54 PST 2013


On Monday, 11 November 2013 at 13:20:04 UTC, bearophile wrote:
> Philippe Sigaud:
>
>> And I agree with you than character literals should default to 
>> dchar. It's
>> a perpetual source of friction for me.
>
> 99% of my char literals need to be of type char.
>
> On the other hand once you have suffixes to specify the char 
> type, most of that problem vanishes, because writing 'x'c or 
> 'x'w, 'x'd is good.
>
> Bye,
> bearophile

Or, uniform construction for built-in types would be another 
better way.

auto c = char('a');
auto w = wchar('a');
auto d = dchar('a');

auto x = char('à');   // compile-time error

Kenji Hara


More information about the Digitalmars-d-learn mailing list