Implemented std::map decode (and fixed bug in the Node iterator - the reference_type should be just a plain value, since it's created on-the-fly)

This commit is contained in:
beder
2011-09-12 00:29:39 -05:00
parent cf240daf63
commit f38e38df09
3 changed files with 24 additions and 2 deletions

View File

@@ -76,8 +76,13 @@ namespace YAML
}
static bool decode(const Node& node, std::map<K, V>& rhs) {
if(node.Type() != NodeType::Map)
return false;
rhs.clear();
return false;
for(const_iterator it=node.begin();it!=node.end();++it)
rhs[it->first.as<K>()] = it->second.as<V>();
return true;
}
};

View File

@@ -23,7 +23,8 @@ namespace YAML
iterator_base<V>,
node_iterator,
V,
std::forward_iterator_tag>
std::forward_iterator_tag,
V>
{
private:
template<typename> friend class iterator_base;