having a trivial anonymous function call in template prevents compilation?

Lodovico Giaretta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 17 06:23:29 PDT 2016


On Wednesday, 17 August 2016 at 13:21:16 UTC, Cauterite wrote:
> On Wednesday, 17 August 2016 at 13:18:06 UTC, Adam D. Ruppe 
> wrote:
>> Best you can do is use them in an alias argument directly, but 
>> you cannot use them in an enum argument.
>
> I think you missed the point; it works perfectly fine without 
> having this `({return 0;})()` in the template body (which, as 
> far as I can see, doesn't appear to interact at all with the 
> template argument).

I think he meant that  ({ return 0;})() cannot be executed at 
compile time and assigned to an enum. That's why the 
instantiation is failing.


More information about the Digitalmars-d-learn mailing list