I\'ve been working on a parser for commands (which are fancy wrappers around large arrays of data), and have a queue that unhandled commands reside on. If I nee
Yes, this is perfectly safe:
std::queue q;
// add stuff...
T top = std::move(q.front());
q.pop();
pop() doesn't have any preconditions on the first element in the q having a specified state, and since you're not subsequently using q.front() you don't have to deal with that object being invalidated any more.
Sounds like a good idea to do!