Using traits how do i get a function's parameters as a string?

Gary Willoughby dev at nomad.so
Tue Sep 3 14:01:25 PDT 2013


Using traits how do i get a methods's parameters as a string? Say 
i have the following method:

...
public void setAge(int age)
{
     this._age = age;
}
...

I want a string that is: "(int age)" or how ever many params 
there are. The nearest i got was using this code:

ParameterTypeTuple!(__traits(getMember, T, "setAge")).stringof

Which yieds: "(int)"

Any ideas?


More information about the Digitalmars-d-learn mailing list