determine parameter storage class in D 2.0

Christian Kamm kamm.incasoftware at shift-at-left-and-remove-this.de
Tue Feb 5 10:25:06 PST 2008


For the record, this works for me:

template isRefArg(int i, alias func)
{
    enum isRefArg = 
        ParameterTypeTuple!(func)[i..i+1].stringof == 
        ParameterTypeTuple!(
            void delegate(ref ParameterTypeTuple!(func)[i])
          ).stringof;
}

Note that the [i..i+1] leads to the storage class being retained where [i]
would discard it.

I have reported some of the behavior as bug 1818:
http://d.puremagic.com/issues/show_bug.cgi?id=1818 .

Cheers,
Christian


More information about the Digitalmars-d-learn mailing list