Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #7082

Re: Fast swapping of STL containers

From Victor Bazarov <v.bazarov@comcast.invalid>
Newsgroups comp.lang.c++
Subject Re: Fast swapping of STL containers
Date 2011-06-23 10:05 -0400
Organization A noiseless patient Spider
Message-ID <itvh7m$c95$1@dont-email.me> (permalink)
References <2879c8f0-969f-4ecb-8da8-86874b949168@t38g2000prj.googlegroups.com>

Show all headers | View raw


On 6/23/2011 9:45 AM, ittium wrote:
> I have two containers (same type). Element are getting inserted in the
> first container continuously. while second container is empty. At some
> point of processing I want to swap the container so that first
> container is now empty. What is the efficient container for this
> operation.

All containers are efficient for this operation.

 >  Swapping should involve, adjusting few pointers/parameter,
> no element by element processing should take place. I will highly
> appreciate a sample code.

Homework again?  Read about 'std::swap'.

V
-- 
I do not respond to top-posted replies, please don't ask

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Fast swapping of STL containers ittium <ittium@gmail.com> - 2011-06-23 06:45 -0700
  Re: Fast swapping of STL containers Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-23 10:05 -0400
    Re: Fast swapping of STL containers gwowen <gwowen@gmail.com> - 2011-06-23 08:07 -0700
      Re: Fast swapping of STL containers Rune Allnor <allnor@tele.ntnu.no> - 2011-06-23 22:49 -0700
        Re: Fast swapping of STL containers ittium <ittium@gmail.com> - 2011-06-24 02:16 -0700
          Re: Fast swapping of STL containers Ian Collins <ian-news@hotmail.com> - 2011-06-24 21:27 +1200
            Re: Fast swapping of STL containers ittium <ittium@gmail.com> - 2011-06-24 02:58 -0700
              Re: Fast swapping of STL containers Ian Collins <ian-news@hotmail.com> - 2011-06-24 22:09 +1200
                Re: Fast swapping of STL containers ittium <ittium@gmail.com> - 2011-06-24 03:29 -0700
                Re: Fast swapping of STL containers Ian Collins <ian-news@hotmail.com> - 2011-06-24 22:44 +1200
                Re: Fast swapping of STL containers Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-06-24 13:25 +0200
                Re: Fast swapping of STL containers Ian Collins <ian-news@hotmail.com> - 2011-06-24 23:35 +1200
                Re: Fast swapping of STL containers Pete Becker <pete@versatilecoding.com> - 2011-06-24 07:34 -0400
          Re: Fast swapping of STL containers Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-06-24 13:34 +0200
        Re: Fast swapping of STL containers gwowen <gwowen@gmail.com> - 2011-06-24 03:26 -0700
          Re: Fast swapping of STL containers ittium <ittium@gmail.com> - 2011-06-24 03:30 -0700
            Re: Fast swapping of STL containers gwowen <gwowen@gmail.com> - 2011-06-24 04:01 -0700
              Re: Fast swapping of STL containers Pete Becker <pete@versatilecoding.com> - 2011-06-24 07:37 -0400
                Re: Fast swapping of STL containers gwowen <gwowen@gmail.com> - 2011-06-24 06:11 -0700
  Re: Fast swapping of STL containers Werner <werasm@gmail.com> - 2011-06-24 02:29 -0700
    Re: Fast swapping of STL containers Werner <werasm@gmail.com> - 2011-06-24 04:51 -0700
  Re: Fast swapping of STL containers hanukas <jukka@liimatta.org> - 2011-06-29 05:29 -0700
    Re: Fast swapping of STL containers Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-29 15:45 +0000
      Re: Fast swapping of STL containers hanukas <jukka@liimatta.org> - 2011-06-30 23:46 -0700

csiph-web