Well, I get a vector
from somewhere, and I need to give a list
the same data somewhere. And now I need to convert vector
to list
to O (n)
No problem, the list already has a range constructor:
std::list<your_element_type_here> yay(your_vector.begin(), your_vector.end());
source share