Partially instantiating templates?

Magnus Lie Hetland magnus at
Mon Jan 31 10:25:06 PST 2011

Hm. Using code quite similar to you, supplying a lambda in the second 
aliasing, I get this error:

something.d(93): Error: template instance cannot use local 
'__dgliteral2(__T3)' as parameter to non-global template optArg(alias 

It seems it's explicitly objecting to what I want it to do...

Using optArg!"a", for example, works just fine -- but the whole point 
was to include some local state. Using local functions worked (I 
think...?) when I had a global template.

It seems D's compile-time computation system is less straightforward 
than I thought :)

Magnus Lie Hetland

More information about the Digitalmars-d-learn mailing list