until strange behavior

bearophile bearophileHUGS at lycos.com
Sun Jun 2 06:30:15 PDT 2013


Jack Applegame:

> It is something wrong with ElementType template.
>
> char arr[4] = [1,2,3,0];
> writeln(ElementType!(typeof(arr[])).stringof); // writes dchar

Try also ForeachType:
http://dlang.org/phobos/std_traits.html#.ForeachType

I agree it's often a pain in the ass, but technically it's not a 
bug, it's working as designed.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list