Traits problem

Daniel Ribeiro Maciel daniel.maciel at gmail.com
Fri Dec 4 12:14:46 PST 2009


Hello!

I'm trying to use __traits in the following manner:

import std.stdio;
import std.traits;

class Foo
{
    void bla() {  }
    void foo() {  }
}

int main()
{
    immutable string members[] = [ "bla", "foo" ];
    writeln( typeid(typeof(__traits(getVirtualFunctions, Foo, members[0]) )) );
}

But this won't compile. The error:

main.d(14): Error: string expected as second argument of __traits getVirtualFunctions instead of members[0u]

What can I do? I'm trying to hack the dmd source code in order to fix this. 
Can anyone give me any tips on what to do?

Best regards,
Daniel



More information about the Digitalmars-d mailing list