I have a class where I want the template parameter B to have a default type. The problem is that the default type is a complicated expression depending also on the type of A.
The following code illustrates the situation but does obviously not compile, because defaultB type is not know inside the template expression.
template<class A, class B = defaultB>
class Foo{
typedef A::Bar Bar;
typedef Bar::Ex defaultB;
};
Does anybody have an idea how to solve this problem properly?