compile time output

BCS ao at pathlink.com
Tue Jan 20 10:30:24 PST 2009


Reply to Trass3r,

> Is there any way to output information at compile time other than
> pragma(msg?
> pragma is driving me crazy, the following doesn't work:
> auto members = __traits(allMembers, typeof(this));
> foreach(m; members)
> {
> pragma(msg, m);
> }
> -> Error: string expected for message, not 'm'
> 
> Though the docs clearly state:
> allMembers: "An array of string literals is returned"
> Also checked that, m is of type invariant(char)[].
> Any ideas? -.-
> 

I don't do 2.0 but it looks to me like your mixing runtime and compile time 
stuff. A foreach over an array is a runtime foreach.




More information about the Digitalmars-d-learn mailing list