Only call get_last_child() if the node has children

Explain that the behaviour is otherwise undefined, in the comment.
This commit is contained in:
Florent Le Coz
2014-05-15 00:47:20 +02:00
parent 7c7da2cedb
commit df765faab9
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ public:
XmlNode* add_child(XmlNode* child);
XmlNode* add_child(XmlNode&& child);
/**
* Returns the last of the children
* Returns the last of the children. If the node doesn't have any child,
* the behaviour is undefined. The user should make sure this is the case
* by calling has_children() for example.
*/
XmlNode* get_last_child() const;
/**