Error: template instance does not match template declaration

ref2401 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 29 11:36:01 PDT 2016


On Tuesday, 29 March 2016 at 18:29:27 UTC, Ali Çehreli wrote:
> On 03/29/2016 11:21 AM, ref2401 wrote:
>
> So, dict is a template value parameter of type T[string]. I 
> don't think you can use an associative array as a template 
> value parameter. (Can we?)
>
> However, it is possible to use anything as an alias template 
> parameter.
>
> If it's acceptable in your case, the following works:
>
> private void impl(S, T, alias dict)(S arg)
>         if (is (typeof(dict) == T[S])) {
>
> (Or T[string]).
>
> Ali

alias works for me, thank you.


More information about the Digitalmars-d-learn mailing list