quesiton about <algorithm> and <iterator> libraries

<algorithm> and <iterator> libraries is there like an add function im looking through the libraries don't understand which one i should use for a class object because i made an add function but now i want to get rid of it and use the libaries

If you mean to form sums (in various ways) of objects in containers then you could use accumulate(), with the <numeric> header.
Last edited on
no to add something to a list is it what i meant sorry about that, i meant to say is i want to add something to my list and not really sure what to do or what function to use form those libraries
Last edited on
If it's a std::list then you can use push_back(), push_front() or insert(), depending on where you want to put it. The reference on this site is pretty explanatory.
Topic archived. No new replies allowed.