Foreach with byte problems

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Feb 25 11:34:35 PST 2011


Can this be simplified?:

byte[] arr = to!(byte[])(array(iota(byte.min, byte.max+1)));

The +1 turns byte.max into an int that can store 128. So when I call
array on an iota, I'll get back an int[] of [-128, ..., 127]. And I
have to convert that to a byte[].


More information about the Digitalmars-d-learn mailing list