Property discussion wrap-up

Timon Gehr timon.gehr at gmx.ch
Wed Jan 30 11:26:00 PST 2013


On 01/30/2013 07:55 PM, TommiT wrote:
> On Wednesday, 30 January 2013 at 18:06:47 UTC, Timon Gehr wrote:
>> 2. alias x = foo; // alias to function (same for alias params)
>
> Oh, yeah, now I see what you mean. It would be impossible to alias the
> function name if foo is considered a function call in that case.
>
> Would it be possible that an alias would have multiple interpretations,
> depending on the context where it's used? E.g.
>
> int foo() {...}
>
> alias x = foo;
>
> int value = x;
>
> auto func = &x; // function pointer
>
> Or is that too weird.

The above code is equivalent to

int value = foo;
auto func = &foo;

So I do not see what could be considered weird.


More information about the Digitalmars-d mailing list