Jump to content
  • Advertisement
Sign in to follow this  
terry_burns85

STL: List additions

This topic is 3808 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, anyone able to clear something up for me, i am looking to add a list to another. Do i need to go through the list with an iterator and add each element from that list to the other with the push_front method ( looking to add to front ), or is there a simpler way to add a list to the front of another. Cheers

Share this post


Link to post
Share on other sites
Advertisement
For destructive splicing, see std::list::splice; for nondestructive catenation, see the (iterator,InputIterator,InputIterator) overload of std::list::insert. Note that if you push_front all elements of your addition list in order, those elements will be reversed in the result list.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!