[Issue 18558] Template alias spec incomplete
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Mar 5 16:02:31 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18558
ag0aep6g at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ag0aep6g at gmail.com
--- Comment #2 from ag0aep6g at gmail.com ---
(In reply to Jonathan Marler from comment #1)
> Based on the example in the comment above, the following:
>
> Foo!return42
>
> treats the `return42` part as a function call with no arguments instead of
> passing the `return42` symbol to the Foo template. Note that this is still
> true even if return42 takes arguments, it will treat it as an erroneous
> function call.
No. At that point it's an alias of the function. It gets called inside `Foo`:
----
template Foo(alias x)
{
enum Foo = x; /* This calls x. */
}
----
--
More information about the Digitalmars-d-bugs
mailing list