How to read from std vector front and remove read variable?
Is it:
v.front();
v.erase(v.begin());
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That looks about right, but consider switching to a std::deque which has a pop_front function (which won’t have to move all the elements in the container)