我很困扰。为什么会这样:
double doubleValue = 20;
NcVar variable = {some process obtaining an instance}
map<NcVar,double> th;
th.insert(std::make_pair(variable, doubleValue));
这失败了:
double doubleValue = 20;
NcVar variable = {some process obtaining an instance}
map<NcVar,double> *th = new map<NcVar,double>();
th->insert(std::make_pair(variable, doubleValue));
这意味着,第一个变体以一个键/值对结束,而第二个变量保持映射不变(0 个条目)?