Beta D 2.069.0-b1

Kagamin via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Oct 13 09:07:48 PDT 2015


On Tuesday, 13 October 2015 at 13:57:15 UTC, Meta wrote:
> On Tuesday, 13 October 2015 at 13:18:36 UTC, Kagamin wrote:
>> Well, in order to pass the result of a function call to a 
>> template parameter means that the function must be evaluated 
>> at compile time, which is not always possible, so it probably 
>> doesn't make sense to call a function when passed as a 
>> template argument.
>
> You'd be surprised what DMD thinks is a function call and what 
> isn't.

What doesn't work for you?

extern int f();
struct T(F){}
T!f t; //Error: template instance T!(f) does not match template 
declaration T(F)
struct A(alias F){}
A!f a; //works


More information about the Digitalmars-d-announce mailing list