Maybe you've got this already but I don't see it. The following fails to compile (reports an ambiguity) in g++ 4.0.3: #include <iostream> template<class A, class B=int> class two { }; template<class T> struct print { void operator()(void) const { std::cout << "1" << std::endl; } }; template<template<class> class T, class A> struct print< T<A> > { void operator()(void) const { std::cout << "2" << std::endl; } }; template<template<class, class> class T, class A, class B> struct print< T<A,B> > { void operator()(void) const { std::cout << "3" << std::endl; } }; int main(void) { print< two<int,int> >()(); } Two other compilers I've tried, Portland Group and Intel, compile the code; the executables print "3". That's what I'd have expected. If class B isn't defaulted in class template "two," there's no problem. Martin
Fixed for 4.2.0. This is also a dup of bug 9737. *** This bug has been marked as a duplicate of 9737 ***