ADD: method to prepend a child

This commit is contained in:
Dominik Meyer 2019-04-10 09:52:46 +02:00
parent 2850647c66
commit cf58516daf
No known key found for this signature in database
GPG Key ID: B4C312B600606B64
1 changed files with 9 additions and 0 deletions

View File

@ -194,6 +194,15 @@ namespace Tree
void addChildren(Iter begin, Iter end) { std::copy( begin, end, std::back_inserter( children ) );}
/**
* @brief prepends a container of nodes to the list of children
*
* @param begin - iterator to the beginning of the container of objects of type std::shared_ptr<Tree::BaseNode>
* @param end - iterator to the end of the container of objects of type std::shared_ptr<Tree::BaseNode>
*/
template <typename Iter>
void prependChildren(Iter begin, Iter end) { std::copy( begin, end, std::front_inserter( children ) );}
/**
* @brief finds the next node in the tree of a given type
*