Can someone explain this error?

Bill Baxter wbaxter at gmail.com
Tue Sep 23 17:48:32 PDT 2008


>> > I'm pretty sure it's possible to partially specify a template.  Consider:
>> >
>> >    void main()
>> >    {
>> >        fn!(int)( 5 );
>> >    }
>> >
>> >    void fn(A, B)( B b ) {}
>> >
>> > This works just fine, but if I change the function declaration to:
>> >
>> >    void fn(A, B ...)( B b ) {}
>> >
>> > it fails.  Are variadic templates a special case?
>> >
>> Uh, what compiler are you using?  That fails for me (1.034).
>
> 2.019

It seems all Andrei's usages of the feature in std.algorithm have an
alias parameter as the first, followed by the variadic.

So maybe this is just a code path in the compiler that hasn't been
tickled previously.
Does your code work if you make the first param an alias?

--bb


More information about the Digitalmars-d-learn mailing list