Use pop_back_val() instead of both back() and pop_back().
No functionality change intended.