Partially instantiating templates?

Simen kjaeraas simen.kjaras at gmail.com
Mon Jan 31 10:46:53 PST 2011


Magnus Lie Hetland <magnus at hetland.org> wrote:

> 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  
> fun)
>
> 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 :)

This is a bug. Please report it.

-- 
Simen


More information about the Digitalmars-d-learn mailing list