【发布时间】:2012-01-16 20:00:35
【问题描述】:
我有以下几点:
#include<iostream>
#include<unordered_map>
#include<tuple>
using namespace std;
class CTest {
// Properties
public:
unordered_map<const string, tuple<int, int> > Layout;
// Methods
public:
CTest ();
~CTest ();
};
CTest::CTest () {
Layout["XYZ"] = make_tuple (0, 1);
}
CTest::~CTest () {
// Do nothing
}
int main (int argc, char *argv[]) {
CTest Test;
return 0;
}
编译这个简单的程序会出现以下错误:
错误 C2678:二进制“==”:未找到采用“const std::string”类型的左侧操作数的运算符(或没有可接受的转换)
我在 Windows 7 中使用 Visual Studio 2010 Professional。
【问题讨论】:
标签: c++ unordered-map