XmlNode::add_child can also take a copy of a node

This commit is contained in:
Florent Le Coz
2015-09-18 22:09:26 +02:00
parent 45e8fe56a6
commit 1031989fe2
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -178,6 +178,12 @@ XmlNode* XmlNode::add_child(XmlNode&& child)
return this->add_child(std::move(new_node));
}
XmlNode* XmlNode::add_child(const XmlNode& child)
{
auto new_node = std::make_unique<XmlNode>(child);
return this->add_child(std::move(new_node));
}
XmlNode* XmlNode::get_last_child() const
{
return this->children.back().get();