插入指向矢量时出错

Arn*_*shn 1 c++ stl vector

我有以下CPP代码段和相关的错误消息:

代码段

    struct node{
            char charVal;
            bool childNode;
            struct node *leftChild;
            struct node *rightChild;
    };
    vector<std::pair<int,struct node*> > nodeCountList;
    struct node *nodePtr = new struct node;
    nodeCountList.push_back(1,nodePtr); 
Run Code Online (Sandbox Code Playgroud)

错误信息

error: no matching function for call to ‘std::vector<std::pair<int, node*>, std::allocator<std::pair<int, node*> > >::push_back(int&, node*&)’
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_vector.h:602: note: candidates are: void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = std::pair<int, node*>, _Alloc = std::allocator<std::pair<int, node*> >]
Run Code Online (Sandbox Code Playgroud)

请帮我解决错误信息.

干杯

moc*_*ocj 7

你需要推一个std ::对.

nodeCountList.push_back(std::make_pair(1,nodePtr));
Run Code Online (Sandbox Code Playgroud)