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
Kornel Benko wrote:
> why not:
>
> std::queue a;
> std::queue b;
> swap(b,a);
>
Ignorance, mostly.
Thanks! Alfredo
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
-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
Andre Poenitz wrote:
> swap(a, b);
>
> should do the trick nevertheless.
>
> Andre'
>
Thanks!
Alfredo
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
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
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
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