Get name of alias parameter at compile time?

Jacob Carlborg doob at me.com
Thu Oct 15 09:19:12 PDT 2009


On 10/15/09 18:06, Lutger wrote:
> dsimcha wrote:
>>
>> Yeah, now that I look into it further, what you describe is exactly the
>> problem.
>> The obvious way only works for functions w/o parameters.  I simplified my
>> example before I posted it and never bothered to test it.
>
> See my reply to my reply (sorry!) for a better way to make it work.
>
> It is because of this I think:
>
> void foo() {}
> void bar(int) {}
>
> void main()
> {
>      writeln(foo.stringof); // ok
>      writeln(bar.stringof); // error: not callable using argument types ()
>      writeln(bar(1).stringof); // ok
> }
>
> It should be doable to make a template for getting the proper name of any
> aliased function I think.
>
>

See my reply to dsimcha



More information about the Digitalmars-d mailing list