mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Renamed append -> push_back (to play nice with STL algorithms
This commit is contained in:
@@ -153,7 +153,7 @@ namespace YAML
|
||||
}
|
||||
|
||||
// sequence
|
||||
void node_data::append(node& node, shared_memory_holder /* pMemory */)
|
||||
void node_data::push_back(node& node, shared_memory_holder /* pMemory */)
|
||||
{
|
||||
if(m_type == NodeType::Undefined || m_type == NodeType::Null) {
|
||||
m_type = NodeType::Sequence;
|
||||
@@ -161,7 +161,7 @@ namespace YAML
|
||||
}
|
||||
|
||||
if(m_type != NodeType::Sequence)
|
||||
throw std::runtime_error("Can't append to a non-sequence node");
|
||||
throw std::runtime_error("Can't push_back to a non-sequence node");
|
||||
|
||||
m_sequence.push_back(&node);
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ namespace YAML
|
||||
detail::node& collection = *m_stack.back();
|
||||
|
||||
if(collection.type() == NodeType::Sequence) {
|
||||
collection.append(node, m_pMemory);
|
||||
collection.push_back(node, m_pMemory);
|
||||
} else if(collection.type() == NodeType::Map) {
|
||||
assert(!m_keys.empty());
|
||||
PushedKey& key = m_keys.back();
|
||||
|
Reference in New Issue
Block a user