int[] as constructor

jmh530 john.michael.hall at gmail.com
Tue Dec 4 22:17:04 UTC 2018


I've noticed that I can use int like a constructor, as in:
     int x = int(1);
but I can't do the same thing with slices
     int[] y = int[]([1, 2]);

Is there something I'm missing here or is this a potential 
enhancement? It can make some types of generic code a little more 
annoying.


More information about the Digitalmars-d-learn mailing list