小编Kre*_*van的帖子

错误:没有匹配函数来调用'make_pair(int&,Quest*)'

我在g ++中得到了这个奇怪的错误; 它在Visual Studio中编译得很好.

struct Quest
{
    static map<int, Quest*> Cache;
};

Quest *Quest::LoadFromDb(BaseResult& result, int *id)
{
    Quest *ret;
    if(result.Error())
    {
        if(id)
            Cache.insert(make_pair<int, Quest*>(*id, NULL)); // <--- Problematic line

        return NULL;
    }

// ...
}
Run Code Online (Sandbox Code Playgroud)

确切的错误:

DataFilesStructure.cpp:9135:58:错误:没有匹配函数来调用'make_pair(int&,Quest*)'

c++ gcc compiler-errors

7
推荐指数
3
解决办法
2万
查看次数

标签 统计

c++ ×1

compiler-errors ×1

gcc ×1