我std::map
在这里写了一个小程序,如下所示.
int main() { mapm1; m1.insert(pair (10,15.0)); //step-1 m1.insert(pair (12.0,13)); //step-2 cout<<"map size="< 我创建了一个地图,其中int类型为键,浮点类型为地图m1的值(键 - 值)对
创建一个普通的int-float对并插入到map中.
创建了一个cross float-int对并插入到map中.现在我知道隐式转换正在使这对插入映射.
在这里,我只是不希望发生隐式转换,并且应该给出编译器错误.
在我们尝试执行step-2类型操作时,我必须在此程序/映射中进行哪些更改才能使comipiler标记出错?