Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dictionary 在映射中插入对_Dictionary_Tree_Insert - Fatal编程技术网

Dictionary 在映射中插入对

Dictionary 在映射中插入对,dictionary,tree,insert,Dictionary,Tree,Insert,为了一张地图 map<int,pair<int,int>>m; mapm; 下面这行行行得通 m[level]=pair<int,int>(h,root->data); //root is a pointer to a node in tree m[level]=对(h,根->数据)//根是指向树中节点的指针 但下面的人没有 m.insert(pair<int,pair<int,int>>(level,(h,r

为了一张地图

map<int,pair<int,int>>m;
mapm;
下面这行行行得通

m[level]=pair<int,int>(h,root->data);       //root is a pointer to a node in tree
m[level]=对(h,根->数据)//根是指向树中节点的指针
但下面的人没有

m.insert(pair<int,pair<int,int>>(level,(h,root->data)));
m.insert(成对(级别,(h,根->数据));

为什么??< P/> < P>我建议在线程中添加C++标记。使用std::make_pair进行配对。实际上,不建议使用
使用名称空间std


它不编译还是不工作?@pesuww它甚至不编译。
m.insert(std::make_pair(level, std::make_pair(h, root->data)))