Why char[] is not @nogc on this case

SrMordred patric.dexheimer at gmail.com
Thu May 24 23:55:24 UTC 2018


int[] a;
int[] b;

()@nogc {
    foreach(v ; chain( a,b ) ) printf("%d\n", v);
}();

//Ok, everything fine;

char[] a;
char[] b;

()@nogc {
    foreach(v ; chain( a,b ) ) printf("%c\n", v);
}();

//Error: @nogc delegate onlineapp.main.__lambda1 cannot call 
non- at nogc function std.range.chain!(char[], 
char[]).chain.Result.front

Why?


More information about the Digitalmars-d-learn mailing list