1
template <class Derived>
struct Base {
typedef typename Derived::T T;
};
template <typename T_>
struct Impl : public Base<Impl<T_>> {
typedef T_ T;
};
これを初期化するとき、私は「Implを」だから、基本クラスから派生したtypenameを取得するには?
、どのように私が得ることができる型名に「T」という名前
無しタイプのエラーは、基本クラスから派生して定義されましたか?
「テンプレート」と「typename」のキーワードはどこでどこに置かなければならないのですか?(https://stackoverflow.com/questions/610245/where-and-why-do-i-have -to-put-the-template-and-typename-keywords) – user0042
これは 'typename 'キーワードそのものではなく、typenameの可視性に関するものです。 –
私はそれが循環定義の一種だと言うでしょう、あなたはImplでTを2回定義しています、 'struct Impl:public Base {'? –
nsubiron