diff --git a/include/yaml-cpp/node/convert.h b/include/yaml-cpp/node/convert.h index 6f19d8e..2e2f3f9 100644 --- a/include/yaml-cpp/node/convert.h +++ b/include/yaml-cpp/node/convert.h @@ -128,7 +128,7 @@ namespace YAML static Node encode(const std::map& rhs) { Node node(NodeType::Map); for(typename std::map::const_iterator it=rhs.begin();it!=rhs.end();++it) - node[it->first] = it->second; + node.force_insert(it->first, it->second); return node; }