Template specialization ordering rules
David Nadlinger
see at klickverbot.at
Sun Apr 10 13:51:42 PDT 2011
On 4/10/11 10:15 PM, Jonathan M Davis wrote:
> I think that the issue here is that Foo!(bar!float) works with _both_
> templates.[snip tldr]
No, that isn't the issue here – there are specialization rules in place
for D templates as well. Actually, I should have mentioned that the
sample works fine without the U parameter on the specialization:
---
struct Foo(T) {}
struct Foo(T : Bar!R, R) {}
struct Bar(R) {}
Foo!(Bar!float) f; // correctly instantiates the second one
---
David
More information about the Digitalmars-d
mailing list