Re: queue

2003-02-21 Thread Duncan Simpson
The fact that queues do not have swap() methods, or fast reverse or merge methods, means I usually end up implementing my own versions---sometimes I use a special opeation so heavily it must be fast. word2x attatches one queue to the end of another queue very frequently, for example and has it's o

Re: queue

2003-02-20 Thread Alfredo Braunstein
Kornel Benko wrote: > why not: > > std::queue a; > std::queue b; > swap(b,a); > Ignorance, mostly. Thanks! Alfredo

Re: queue

2003-02-20 Thread Andre Poenitz
On Thu, Feb 20, 2003 at 01:00:46PM +0100, Alfredo Braunstein wrote: > > swap(a, b); > > Thanks! And now the official explanation: list, vector and deque are containers which have to satisfy the 'container requirements' (including swap member). stack and queue are container adap

Re: queue

2003-02-20 Thread Kornel Benko
-BEGIN PGP SIGNED MESSAGE- On Donnerstag, 20. Februar 2003 12:36, Alfredo Braunstein wrote: > queue a; > queue b; > a.swap(b); why not: std::queue a; std::queue b; swap(b,a); Kornel - -- Kornel Benko [EMAIL PROTECTED] -BEGIN PGP SIGNATUR

Re: queue

2003-02-20 Thread Alfredo Braunstein
Andre Poenitz wrote: > swap(a, b); > > should do the trick nevertheless. > > Andre' > Thanks! Alfredo

Re: queue

2003-02-20 Thread Andre Poenitz
On Thu, Feb 20, 2003 at 12:36:31PM +0100, Alfredo Braunstein wrote: > int main (int, char **) > { > queue a; > queue b; > a.swap(b); Hm. swap(a, b); should do the trick nevertheless. Andre' -- Those who desire to give up Freedom in order to gain Security, will

Re: queue

2003-02-20 Thread Alfredo Braunstein
Andre Poenitz wrote: > On Wed, Feb 19, 2003 at 07:47:26PM +0100, Alfredo Braunstein wrote: >> Sorry for the dumb question, but why is it that a std::queue doesn't have >> a swap() method while list, map, set and vector all have it ? > > Doesn't it have one? > > queue is implemented to top of deq

Re: queue

2003-02-20 Thread Andre Poenitz
On Wed, Feb 19, 2003 at 07:47:26PM +0100, Alfredo Braunstein wrote: > Sorry for the dumb question, but why is it that a std::queue doesn't have a > swap() method while list, map, set and vector all have it ? Doesn't it have one? queue is implemented to top of deque, which has one. And swap is lis

Re: queue

2003-02-19 Thread Kuba Ober
On środa 19 luty 2003 01:47 pm, Alfredo Braunstein wrote: > Sorry for the dumb question, but why is it that a std::queue doesn't have a > swap() method while list, map, set and vector all have it ? Maybe because when one is waiting in a line (a queue!), one doesn't like other people getting in fr