Is the following well-formed?
class policy {}; class policy_interface {}; template <class POLICY_INTERFACE> class aph { protected: typedef POLICY_INTERFACE PI; }; template <class POLICY, class BASE, class PI = typename BASE::PI> class ConcretePolicyHolder : public BASE, protected POLICY {}; ConcretePolicyHolder < policy , aph < policy_interface > > foo; void xx() { }
The issue is whether the access to the default argument type BASE::PI is checked before or after it is known that BASE is a base class of the template. To some extent, one needs to develop the list of template arguments (and therefore evaluate the default argument) before one can instantiate the template, and one does not know what base classes the template has until it has been instantiated.