Copying a list to a vector

is there any way to copy an entire list to a vector? would make my life much easier
You mean something like
1
2
3
4
5
std::list<int> myList;
// ... Populate 'myList' ...

// Make a copy
std::vector<int> myVecThatIsACopyOfMyList(std::begin(myList), std::end(myList));
?
std::copy in <algorithim> should work
Spot on guys thanks :)
Topic archived. No new replies allowed.