我有这个...C++模板和结构问题
template <typename Key, typename Value>
class A {
public:
//...
private:
struct MyStruct{
Key key;
Value value;
};
};
,这让我以下错误:
Error 1 error C2146: syntax error : missing ';' before identifier 'value'
Error 2 error C4430: missing type specifier - int assumed.
Error 3 error C4430: missing type specifier - int assumed.
一些规格: 使用Visual Studio 2010 Windows 7的64位
我的错误可以在这些行之前还是之后?
显示这是造成错误的代码了。顺便说一下,您在类定义的末尾丢失了一个分号。 –
这取决于你发送给模板的类型。你能提供一个完整的错误的例子,也是你的用法的例子吗? – Suroot
为我编译使用xcode(gcc4.2) – Colin