0
#pragma once
//includes
template<class RefType>
class Foo
{
public:
template<>
enum Foo<QString>::bar { //values A }; //LINE X
template<>
enum Foo<double>::bar { //values B };
template<>
enum Foo<Kraken::Point3>::bar { //values C };
//functions
}; //LINE Y
編譯器給出了LINE X故障使用模板: '類' 型redifinition
error C2011: 'Foo<QString>': 'class' type redefinition
與筆記
note: see declaration of 'Foo<QString>' LINE X
note: note: see reference to class template instantiation 'Foo<RefType>'LINE Y
我不明白,這個錯誤的根源錯誤,如果我對這個問題變得更加開明瞭,我會將問題的重新格式化,以便更清晰
代碼中的「foo」和「bar」是什麼? – xinaiz
班級名稱(Foo)和枚舉名稱(bar)的站點名稱 – brettmichaelgreen
標題中的「第44集」是什麼意思? – tambre