入れ子のテンプレートクラスを取得しようとしています。
コンパイラは私に次のエラーを与える:入れ子のテンプレートクラス
error: type/value mismatch at argument 1 in template parameter list for ‘template class MyClass’ note: expected a class template, got ‘SpecificType {aka TemplateClass< Type1, Typ2, Type3 >}
は、これは私のコード
/* ...class definition... */
template < template < typename T1,typename T2,typename T3 > typename T>
class MyClass{
// is there a way to have these types available here
// passing one single specialized type in the main?
T1 member1;
T2 member2;
T3 member3;
T<T1, T2, T3> member4;
};
/* ...in my main... */
using SpecificType = TemplateClass< Type1, Type2, Type3 >;
SpecificType test_object; //until here compiles
MyClass<SpecificType> myclass;
である私はすでにSpecificTypeオブジェクトを定義しようとしましたが、その時点までに私のコードはコンパイルして動作します。
'SpecificType'はもうtempalteではありません(あなたは' TemplateClass'にパラメータを渡しています)。 'MyClass'は細かいものでなければなりません。 –
user463035818