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


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

Re: Marshalling deques

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Bo Persson" <bop@gmb.dk>
Newsgroups comp.lang.c++
Subject Re: Marshalling deques
Date Wed, 17 Aug 2011 12:23:00 +0200
Lines 25
Message-ID <9b1j3vFbf3U1@mid.individual.net> (permalink)
References <a824c198-7623-4124-981b-0aaa1c28d90c@a4g2000yqg.googlegroups.com>
X-Trace individual.net e7ntgtc/c6ZVVOkEN1IwCAr7+34021VrBg4PpY3YobN37DyQ07
Cancel-Lock sha1:NDEPZ0G9XvPZbd8cvi1tKh3jiag=
X-Priority 3
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.6109
X-RFC2646 Format=Flowed; Original
X-Antivirus avast! (VPS 110817-0, 2011-08-17), Outbound message
X-Antivirus-Status Clean
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:8972

Show key headers only | View raw


Ebenezer wrote:
> When you have a vector of a primitive type, rather than
> iterating through each element, you can marshal the vector
> with the address of the first element and multiply the size
> of the vector with the size of each element like this:
>
> buf.Receive(&*vec.begin(),  vec.size() * sizeof(T));
>
> I'd like to do something similar with deques, but they are
> implemented in chunks rather than a single chunk.  How
> to get the address and size of each chunk, though?  Tia.
>
> http://www.gotw.ca/gotw/054.htm
>

You cannot.

Deque has to use a two level addressing, probably involving an array 
of pointers to the chunks, but the details are not specified by the 
standard. There is no interface to this internal structure.


Bo Persson

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


Thread

Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-16 19:13 -0700
  Re: Marshalling deques "Bo Persson" <bop@gmb.dk> - 2011-08-17 12:23 +0200
    Re: Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-17 09:28 -0700
      Re: Marshalling deques Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-17 13:32 -0400
        Re: Marshalling deques Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 18:41 +0100
          Re: Marshalling deques Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 18:46 +0100
          Re: Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-17 11:08 -0700
            Re: Marshalling deques Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 19:12 +0100
              Re: Marshalling deques Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 19:21 +0100
        Re: Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-17 15:06 -0700
          Re: Marshalling deques Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 23:29 +0100
            Re: Marshalling deques Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 23:34 +0100
              Re: Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-18 08:59 -0700
          Re: Marshalling deques Jeff Flinn <TriumphSprint2000@hotmail.com> - 2011-08-17 21:10 -0400
          Re: Marshalling deques "Bo Persson" <bop@gmb.dk> - 2011-08-18 14:24 +0200
            Re: Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-18 08:53 -0700
              Re: Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-19 15:39 -0700
                Re: Marshalling deques Ebenezer <woodbrian77@gmail.com> - 2011-08-22 12:39 -0700
      Re: Marshalling deques "Bo Persson" <bop@gmb.dk> - 2011-08-18 14:22 +0200
  Re: Marshalling deques ptyxs <kerloch@gmail.com> - 2011-08-17 09:43 -0700

csiph-web