lundi 28 novembre 2016

`std::unordered_map

I have

std::unordered_map<std::string, std::shared_ptr<ClassA>> symbolTable = std::unordered_map<std::string, std::shared_ptr<ClassA>>();

void setVariable(std::string variableName, std::shared_ptr<TypeStruct> value) {
    symbolTable.insert(std::make_pair(variableName, value));
}

But I get

EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

When I try to use this. Any thoughts as to why? Is there a problem with pushing std::shared_ptr into the map?

Aucun commentaire:

Enregistrer un commentaire