Re: "optional" func alias template param

2011-04-10 Thread Robert Clipsham
On 10/04/2011 15:31, spir wrote: I'd also like to know why pointer cannot be template *alias* parameters, like in: auto s2 = S!(&f)(); ==> Error: expression & f is not a valid template value argument Denis First of all, that error is useless, you should probably report a bug for that (particu

Re: "optional" func alias template param

2011-04-10 Thread spir
On 04/10/2011 04:10 PM, spir wrote: Hello, I need a trick to allow a function template parameter be optional. The following (reduced case) fails because D wants to call f: uint f(uint i) { return i; } struct S (alias func=null) { enum bool hasFunc = !(func == null); // *** error line *** } unit

Re: "optional" func alias template param

2011-04-10 Thread spir
On 04/10/2011 04:10 PM, spir wrote: Hello, I need a trick to allow a function template parameter be optional. The following (reduced case) fails because D wants to call f: uint f(uint i) { return i; } struct S (alias func=null) { enum bool hasFunc = !(func == null); // *** error line *** } unit