Determine if a member is a method

Gary Willoughby dev at nomad.so
Wed Jan 1 06:22:56 PST 2014


On Wednesday, 1 January 2014 at 12:19:29 UTC, Jacob Carlborg
wrote:
> On 2014-01-01 08:43, Frustrated wrote:
>
>> Also, how does one get the exact code string of a member 
>> instead of
>> having to piece it together from info from std.traits? (which 
>> requires a
>> lot of work)?
>
> You mean the to get the full signature of a method? I don't 
> think that's possible, unless you can use __PRETTY_FUNCTION__ 
> [1] somehow.
>
> [1] http://dlang.org/traits.html#specialkeywords

I have some useful templates in the source of DUnit which does
this. Take a look and customise for what you need:

https://github.com/nomad-software/dunit/blob/master/source/dunit/reflection.d#L639


More information about the Digitalmars-d-learn mailing list