char array weirdness

Jack Stouffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 28 15:34:31 PDT 2016


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?


More information about the Digitalmars-d-learn mailing list