Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change last element of a queue

Status
Not open for further replies.

Maurader

Technical User
May 8, 2002
59
CA
is there a way to change the last element of a queue after it's been enqueued?
 
There shouldn't be. Period. You SHOULDN'T be able to do anything to anything in the queue except for pushing to the back and popping from the front (OK and looking at the front).
...
...
HOWEVER...
For an STL queue, there is a function called back() that will return either a const reference to the last element or a mutable reference to the last element (which would be nice in your case). There ya go.

Hope it helps...
-Skatanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top