push_back中的2个参数
我试图使用push_back在向量中放入2个参数,但它给我一个错误,因为该函数只允许一个参数。我怎么能传递2个参数?
顶点类:
template <class VertexType, class EdgeType> class Vertex{
public:
std::vector<std::pair<int, EdgeType>> VertexList;
};
Main()内的Vertex类外:
project3::Vertex<string, string> v1("v1");
v1.VertexList.push_back(1,"e1");
错误是:
错误C2661:'std :: vector&lt; _Ty> :: push_back':没有重载函数需要2个参数
IntelliSense:函数调用中的参数太多
没有找到相关结果
已邀请:
2 个回复
骂陋冠
甲车劲