char array weirdness

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 29 16:15:26 PDT 2016


On Monday, 28 March 2016 at 22:34:31 UTC, Jack Stouffer wrote:
> void main () {
>     import std.range.primitives;
>     char[] val = ['1', '0', 'h', '3', '6', 'm', '2', '8', 's'];
>     pragma(msg, ElementEncodingType!(typeof(val)));
>     pragma(msg, typeof(val.front));
> }
>
> prints
>
>     char
>     dchar
>
> Why?

I've seen you so many time as a reviewer on dlang that I belive 
this Q is a joke.
Even if obviously nobody can know everything...

https://www.youtube.com/watch?v=l97MxTx0nzs

seriously you didn't know that auto decoding is on and that it 
gives you a dchar...



More information about the Digitalmars-d-learn mailing list