C++填充地图

C++填充地图,c++,vector,map,C++,Vector,Map,我有两个stl容器: vector<vector<int>> numbers; vector<string> names; 为什么失败?您尝试分配vector,但名称\u数字值属于vector类型 您已经声明了将值作为字符串向量的映射,而您正在向其中插入int向量 names_numbers[names[i]] = numbers[i]; <<< It's a vector of int's. vector<vector<int

我有两个stl容器:

vector<vector<int>> numbers;
vector<string> names;
为什么失败?

您尝试分配vector,但名称\u数字值属于vector类型

您已经声明了将值作为字符串向量的映射,而您正在向其中插入int向量

names_numbers[names[i]] = numbers[i]; <<< It's a vector of int's.
vector<vector<int>> numbers;

显示meno_cisla的声明。是否使用命名空间std;?因为编译器认为它是std::map[key]而不是map[key]。是的,我正在使用它。如何在不停止使用该名称空间的情况下解决它?使用名称空间std与此运算符无关。
Error   3   error C2679: binary '=' : no operator found which takes a right-hand operand of typ 'std::vector<int,std::allocator<_Ty>>' (or there is no acceptable conversion)
map[key] = value;
map<string, vector<string>> names_numbers;
names_numbers[names[i]] = numbers[i]; <<< It's a vector of int's.
vector<vector<int>> numbers;