Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Template specialization selection/ambiguity

$
0
0
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!

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>