[英]How do I copy key value pair references from one map to another map of the same type?
I have two maps in C++ of type std::map < std::string , std::vector < std::set< std::string>::iterator>>
. 我在C ++中有两个类型为
std::map < std::string , std::vector < std::set< std::string>::iterator>>
。
catalog
duplicatesCatalog
I would like to insert the reference of elements of catalog(key,value)
into duplicatesCatalog
on a scenario where the size of the vector of iterators in catalog is greater than 2. 我想在目录中迭代器向量的大小大于2的情况下,将
catalog(key,value)
元素的引用插入duplicatesCatalog
副本目录中。
How do I do it? 我该怎么做?
使用std::reference_wrapper
作为duplicatesCatalog
参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.