Hi, quick question.. Why is the type of "fooBar" ambiguous?
template< typename T >
struct Bar
{
};
template< typename T1, typename T2 >
struct Foo;
template< typename T >
struct Foo< T, Bar< T > >
{
};
template< typename T >
struct Foo< float, Bar< T > >
{
};
Foo< float, Bar< float > > fooBar;
I would expect that the second version of Foo is more specialized than the first...
(I am building a compiler and I would like to understand the template specialization selection algorithm)
Cheers!
↧