Copying copy?
Dicebot
public at dicebot.lv
Fri Jul 26 08:24:55 PDT 2013
On Friday, 26 July 2013 at 14:46:23 UTC, bearophile wrote:
> import std.range, std.algorithm;
> void main() {
> char[5] arr;
> auto r = 5.iota.map!(i => cast(char)(i + 'a'));
> static assert(is(typeof(r.front) == char)); // OK
> r.copy(arr[]); // error
> }
Not possible, front is 'dchar' for char arrays:
import std.array;
void main()
{
char[5] arr;
pragma(msg, typeof(arr.front));
// dchar
}
More information about the Digitalmars-d-learn
mailing list