From 4f8680b54044d4af83a288332f34833ae8f6abfa Mon Sep 17 00:00:00 2001 From: Jesse Beder Date: Fri, 9 Sep 2011 02:39:36 -0500 Subject: [PATCH] Switched operator[] access to node reference equality, not node equality --- src/value/detail/node_data.cpp | 6 +++--- util/value.cpp | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/value/detail/node_data.cpp b/src/value/detail/node_data.cpp index 9d507cc..03eeec7 100644 --- a/src/value/detail/node_data.cpp +++ b/src/value/detail/node_data.cpp @@ -64,7 +64,7 @@ namespace YAML return pMemory->create_node(); 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; } @@ -88,7 +88,7 @@ namespace YAML } 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; } @@ -103,7 +103,7 @@ namespace YAML return false; 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); return true; } diff --git a/util/value.cpp b/util/value.cpp index b8ac6af..14f206b 100644 --- a/util/value.cpp +++ b/util/value.cpp @@ -20,5 +20,9 @@ int main() names[4] = "four"; value["names"] = names; + value["this"] = value; + value["this"]["change"] = value; + value["this"]["change"] = 5; + return 0; }