"optional" func alias template param

Robert Clipsham robert at octarineparrot.com
Sun Apr 10 07:57:15 PDT 2011


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 (particularly if it doesn't include a line number, I'm not sure 
if you've omitted that or not).

Secondly, alias parameters are used to pass a symbol to a template, &f 
is not a symbol, it's a pointer to the value held in symbol f.

--
Robert
http://octarineparrot.com/


More information about the Digitalmars-d-learn mailing list