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


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

Re: Marshalling deques

From "Bo Persson" <bop@gmb.dk>
Newsgroups comp.lang.c++
Subject Re: Marshalling deques
Date 2011-08-17 12:23 +0200
Message-ID <9b1j3vFbf3U1@mid.individual.net> (permalink)
References <a824c198-7623-4124-981b-0aaa1c28d90c@a4g2000yqg.googlegroups.com>

Show all headers | 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