Renamed append -> push_back (to play nice with STL algorithms

This commit is contained in:
beder
2012-01-21 12:11:40 -06:00
parent 5647711578
commit 8d0ee05dbe
9 changed files with 18 additions and 18 deletions

View File

@@ -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);
}

View File

@@ -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();