Copying copy?

bearophile bearophileHUGS at lycos.com
Thu Jul 25 16:55:46 PDT 2013


Range-based functions see strings and char[] to arrays of dchar, 
but is that behavour good for std.algorithm.copy too?

I find this a bit silly:


import std.algorithm: copy;
void main() {
     char[5] arr1 = "hello", arr2;
     arr1[].copy(arr2[]); // Error.
     dchar[arr1.length] arr3;
     arr1[].copy(arr3[]); // OK.
}


What do you think?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list