0
为什么我不能编译这段代码?简单图<>实例化,我无法编译,请帮忙
#include <map>
using namespace std;
class MyTest {
template<typename T> void test() const;
};
template<typename T> void MyTest::test() const {
map<string, T*> m;
map<string, T*>::const_iterator i = m.begin();
}
我的编译器说:
In member function ‘void MyTest::test() const’:
test.cpp:8: error: expected `;' before ‘i’
它是什么?提前谢谢了!