std.metastrings.ToString! problems

asd no at spam.com
Thu Jul 23 15:14:49 PDT 2009


I'm trying to write basic compile-time function:

string usedForMixin()
{
 int n=0; 
 /* do stuff */
 return "int x = " ~ std.metastrings.ToString!(n) ~ ";";
}

However I'm getting:
/usr/local/bin/../src/phobos/std/metastrings.d(104): Error: expression cast(long)n is not a valid template value argument

If I change int to long:
/usr/local/bin/../src/phobos/std/metastrings.d(87): Error: expression n < 0L is not constant or does not evaluate to a bool

(D2, OS X)



More information about the Digitalmars-d mailing list