The return type of std::queue::pop()
is void
. Hence, you may not use:
reverse.push(Q.pop());
You can use:
reverse.push(Q.front());
Q.pop();
0
solved Invalid use of void expression with a Queue and .pop()
The return type of std::queue::pop()
is void
. Hence, you may not use:
reverse.push(Q.pop());
You can use:
reverse.push(Q.front());
Q.pop();
0
solved Invalid use of void expression with a Queue and .pop()