Switched operator[] access to node reference equality, not node equality
This commit is contained in:
parent
ec95e61c04
commit
4f8680b540
@ -64,7 +64,7 @@ namespace YAML
|
|||||||
return pMemory->create_node();
|
return pMemory->create_node();
|
||||||
|
|
||||||
for(node_map::const_iterator it=m_map.begin();it!=m_map.end();++it) {
|
for(node_map::const_iterator it=m_map.begin();it!=m_map.end();++it) {
|
||||||
if(it->first == &key) // TODO: equality?
|
if(it->first->is(key))
|
||||||
return *it->second;
|
return *it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ namespace YAML
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(node_map::const_iterator it=m_map.begin();it!=m_map.end();++it) {
|
for(node_map::const_iterator it=m_map.begin();it!=m_map.end();++it) {
|
||||||
if(it->first == &key) // TODO: equality?
|
if(it->first->is(key))
|
||||||
return *it->second;
|
return *it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ namespace YAML
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
for(node_map::iterator it=m_map.begin();it!=m_map.end();++it) {
|
for(node_map::iterator it=m_map.begin();it!=m_map.end();++it) {
|
||||||
if(it->first == &key) { // TODO: equality?
|
if(it->first->is(key)) {
|
||||||
m_map.erase(it);
|
m_map.erase(it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,5 +20,9 @@ int main()
|
|||||||
names[4] = "four";
|
names[4] = "four";
|
||||||
value["names"] = names;
|
value["names"] = names;
|
||||||
|
|
||||||
|
value["this"] = value;
|
||||||
|
value["this"]["change"] = value;
|
||||||
|
value["this"]["change"] = 5;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user