What is the "correct" way to add all elements from one std::list to another one?
void
Node::addChilds(const NodeList *list)
{
for(NodeList::const_iterator i = list->begin();
i != list->end();
++i)
{
this->m_childs.push_back(*i);
}
}
I thought about std::copy, but afaik for copy I have to resize the destination list, backup the end iterator (before resize) etc.
I'm searching for a single-line statement.