Template argument deduction not working with template specialization

Steven Schveighoffer schveiguy at gmail.com
Sun Jan 17 20:48:23 UTC 2021


On 1/17/21 3:41 PM, Paul wrote:
> On Sunday, 17 January 2021 at 16:42:27 UTC, Steven Schveighoffer wrote:

>> This works:
>>
>> void TFoo(T : U[], U)(T a)
> 
> Oh cool, that's surprising to say the least. Thanks! This indeed works 
> with argument deduction :)

It's basically saying if T matches the pattern U[] for some U (which is 
actually defined now inside the function), then it's a match (and 
preferred over the non-specialized template).

-Steve


More information about the Digitalmars-d-learn mailing list