template <...>
class InheritedByManyClasses
{
public:
typedef InheritedByManyClasses<...> ParentClass;
};
如果我做的那是也多個類的父一子,有沒有什麼辦法鏈這個想法在一起嗎?
template<...>
class ChildInheritedByMany : InheritedByManyClasses<...>
{
public:
typedef ... ParentClass; // oops! now this class can't benefit from parent typedef
};
有一些方法我可以在這只是可見其孩子的孩子typedef
?
我從每一個答案中學到了一些東西,但是這個答案最接近於回答我試圖問的東西。 –