Get complete function declaration

SrMordred via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 18 07:20:17 PDT 2017


On Tuesday, 18 July 2017 at 13:53:11 UTC, Ivan Kazmenko wrote:
> On Tuesday, 18 July 2017 at 13:35:49 UTC, SrMordred wrote:
>> There is a way to get the full function(or any other 
>> structure) declaration with traits? Or I will have to mount it 
>> with std.traits functions?
>>
>> eg.
>> void add(int x, int y){}
>>
>> GetFullFunctionDeclaration!add; //return "void add(int x, int 
>> y)"
>
> There are several function traits in std.traits (see 
> https://dlang.org/phobos/std_traits.html), which can hopefully 
> be combined to reconstruct a function declaration.
>
> I don't see a single method which would do what you want out of 
> the box.  Perhaps there is none, since different use cases 
> would require different small subsets of features, and all the 
> orthogonal features are already available.
>
> Ivan Kazmenko.

Thanks!
I´ll have to build one so :)


More information about the Digitalmars-d-learn mailing list