start a list from the second element
-
Hi
" but it does not work"what happens ?
-
@micheal15 No one knows since you're not telling us what isn't working
-
what is list? a vector, a list? what? not looking at the docs, but I'm not sure that std::list even supports the at() method...and upon checking...no, it does not.
-
for what its worth: use the ugly option below, or switch to a container that supports random element access
auto obj = list.front(); list.pop_front(); auto atOne = list.front(); list.push_front(obj);