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
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
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