Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > STL - delete current object in queue

Reply
Thread Tools

STL - delete current object in queue

 
 
hariharan.priya@gmail.com
Guest
Posts: n/a
 
      06-07-2006
I am a beginner working with STLs

I need to delete the current object in the queue. Which container
provides this function? and which algorithm should i use?

Thank you

 
Reply With Quote
 
 
 
 
Andre Kostur
Guest
Posts: n/a
 
      06-07-2006
On Wed, 07 Jun 2006 08:08:04 -0700, "hariharan.priya wrote:

> I am a beginner working with STLs
>
> I need to delete the current object in the queue. Which container provides
> this function? and which algorithm should i use?


All of them. And assuming that you have an iterator to the element that
you want to remove, call the .erase() method on the container and pass it
the iterator.
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      06-07-2006
wrote:
> I am a beginner working with STLs
>
> I need to delete the current object in the queue. Which container
> provides this function? and which algorithm should i use?


What is the "queue" that you refer to? In case you didn't know,
there is 'std::queue' "container" (actually it's an adapter).
And what do you mean by "delete the current object"? Usually
removing the object from a container disposes of it, and there
is no need to additionally "delete" it.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
Mike Smith
Guest
Posts: n/a
 
      06-07-2006
wrote:
> I am a beginner working with STLs
>
> I need to delete the current object in the queue. Which container
> provides this function? and which algorithm should i use?


What do you mean by "current object"?

--
Mike Smith
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program blocked in Queue.Queue.get and Queue.Queue.put Kris Python 0 01-04-2012 03:46 PM
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
Is Queue.Queue.queue.clear() thread-safe? Russell Warren Python 4 06-27-2006 03:03 PM
what's the difference between #include "queue.h" and #include "queue.cpp" Kceiw C++ 3 03-14-2006 03:01 AM
Queue.Queue-like class without the busy-wait Paul L. Du Bois Python 29 04-04-2005 01:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57