Added force_insert for mapping nodes that doesn't check to see if the key exists already (so it could duplicate keys)

This commit is contained in:
Jesse Beder
2012-10-31 19:08:09 -05:00
parent a645866ffa
commit 09b4706faf
8 changed files with 79 additions and 1 deletions

View File

@@ -358,9 +358,16 @@ namespace YAML
key.EnsureNodeExists();
return m_pNode->remove(*key.m_pNode, m_pMemory);
}
// map
template<typename Key, typename Value>
inline void Node::force_insert(const Key& key, const Value& value)
{
EnsureNodeExists();
m_pNode->force_insert(detail::to_value(key), detail::to_value(value), m_pMemory);
}
// free functions
inline bool operator==(const Node& lhs, const Node& rhs)
{
return lhs.is(rhs);