我正在尝试使用 push_back 将 2 个参数放入一个向量中,但它给了我一个错误,因为该函数只允许使用一个参数。我怎样才能传递 2 个参数?
顶点类:
template <class VertexType, class EdgeType> class Vertex{
public:
std::vector<std::pair<int, EdgeType>> VertexList;
};
Main() 内部的外部顶点类:
project3::Vertex<string, string> v1("v1");
v1.VertexList.push_back(1,"e1");
错误是:
错误 C2661:'std::vector<_Ty>::push_back':没有重载函数需要 2 个参数 IntelliSense:函数调用中的参数太多