Ambiguous multiple inheritance of template classes
问题 I've got a real situation which can be summarized in the following example: template< typename ListenerType > struct Notifier { void add_listener( ListenerType& ){} }; struct TimeListener{ }; struct SpaceListener{ }; struct A : public Notifier< TimeListener > , public Notifier< SpaceListener > { }; struct B : TimeListener{ }; int main() { A a; B b; a.add_listener( b ); // why is ambiguous? return 0; } Why is not obvious to the compiler that B is a TimeListener , and therefore the only