If I have class Bar(T) { } void foo(Y)() { ... } Is there a way to check inside foo() that Y is in some way an instantiation of Bar? Is there a way to find WHICH instantiation it is?