I get this weird error in g++; it compiles fine in 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;
}
// ...
}
Exact error:
DataFilesStructure.cpp:9135:58: error: no matching function for
call to ‘make_pair(int&, Quest*)’
Does it work with an explicit cast?
Also, a cpp file with 9000 lines, really?