Contiguous storage for <vector>

Discussion in 'C++' started by Dave Rahardja, Oct 25, 2005.

  1. Where is it specified that data storage for <vector> must be contiguous? i.e.,

    Assuming v is a vector of some size,

    &v[1] == &v[0] + 1;

    -dr
     
    Dave Rahardja, Oct 25, 2005
    #1
    1. Advertising

  2. * Dave Rahardja:
    >
    > Where is it specified that data storage for <vector> must be contiguous? i.e.,
    >
    > Assuming v is a vector of some size,
    >
    > &v[1] == &v[0] + 1;
    >


    §23.2.4/1 in C++2003, "The elements of a vector are stored contigously, ...".

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Oct 25, 2005
    #2
    1. Advertising

  3. On Tue, 25 Oct 2005 13:41:23 GMT, (Alf P. Steinbach) wrote:

    >* Dave Rahardja:
    >>
    >> Where is it specified that data storage for <vector> must be contiguous? i.e.,
    >>
    >> Assuming v is a vector of some size,
    >>
    >> &v[1] == &v[0] + 1;
    >>

    >
    >§23.2.4/1 in C++2003, "The elements of a vector are stored contigously, ...".


    What is this C++2003 you speak of?

    -dr
     
    Dave Rahardja, Oct 26, 2005
    #3
  4. On Wed, 26 Oct 2005 02:33:16 GMT, Dave Rahardja <> wrote:

    >On Tue, 25 Oct 2005 13:41:23 GMT, (Alf P. Steinbach) wrote:
    >
    >>* Dave Rahardja:
    >>>
    >>> Where is it specified that data storage for <vector> must be contiguous? i.e.,
    >>>
    >>> Assuming v is a vector of some size,
    >>>
    >>> &v[1] == &v[0] + 1;
    >>>

    >>
    >>§23.2.4/1 in C++2003, "The elements of a vector are stored contigously, ...".

    >
    >What is this C++2003 you speak of?


    Never mind! My copy of the Standard is obsolete. Duly updated.

    -dr
     
    Dave Rahardja, Oct 26, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newsgroup - Ann
    Replies:
    0
    Views:
    407
    Newsgroup - Ann
    Aug 15, 2003
  2. Ravi
    Replies:
    8
    Views:
    10,344
    Mike Wahler
    Mar 6, 2004
  3. Mark McDougall

    Non-contiguous port vector ranges???

    Mark McDougall, Nov 2, 2006, in forum: VHDL
    Replies:
    2
    Views:
    797
    Jim Lewis
    Nov 2, 2006
  4. jmcgill

    Contiguous storage of ints?

    jmcgill, Oct 6, 2006, in forum: C Programming
    Replies:
    9
    Views:
    292
    Frederick Gotham
    Oct 6, 2006
  5. Replies:
    8
    Views:
    1,960
    Csaba
    Feb 18, 2006
Loading...

Share This Page