having a trivial anonymous function call in template prevents compilation?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 17 06:33:26 PDT 2016


On 8/17/16 9:23 AM, Lodovico Giaretta wrote:
> 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.

Yes, it can: https://dpaste.dzfl.pl/fca15065a4cf

I think the OP's case is a bug. Please file.

-Steve


More information about the Digitalmars-d-learn mailing list