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


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

Re: Marshalling deques

From Jeff Flinn <TriumphSprint2000@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Marshalling deques
Date 2011-08-17 21:10 -0400
Organization GC
Message-ID <j2horq$ege$1@dont-email.me> (permalink)
References <a824c198-7623-4124-981b-0aaa1c28d90c@a4g2000yqg.googlegroups.com> <9b1j3vFbf3U1@mid.individual.net> <27aeb4b8-3d21-435c-bfe8-be22eb62fe75@i9g2000yqk.googlegroups.com> <j2gtul$21l$1@dont-email.me> <51f7e8e2-f7ce-42e1-b404-a005f166dfa0@l37g2000yqd.googlegroups.com>

Show all headers | View raw


Ebenezer wrote:
> On Aug 17, 12:32 pm, Victor Bazarov <v.baza...@comcast.invalid> wrote:
>> On 8/17/2011 12:28 PM, Ebenezer wrote:
>>
>>> On Aug 17, 5:23 am, "Bo Persson"<b...@gmb.dk>  wrote:
>>>> 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.
>>> In that case, how about changing the standard?  I believe iterating
>>> through a deque is more involved than iterating through a vector.
>> So?  
> 
> It seems that being able to bypass the relatively slower deque
> iterators would be helpful.

google the segmented iterator paper by Matt Austern, IIRC.

Jeff

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