I'm new to C++, so bear with me. I'm using a queue from the standard template library. I'm using it with type Node*. I'm wondering how to return the top item. I noticed that the pop() is of type void so this is what I've done:
Code:
Node* removeNext(){
Node* node = 0;
if(!fringe.empty()){
node = fringe.front();
fringe.pop();
}
return node;
}
is this the right way to try to pop the top item off?