mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
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:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user