Re: Is std::vector contiguous?

From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 03/06/04


Date: Sat, 06 Mar 2004 00:47:19 GMT


"Ravi" <rg27@cse.buffalo.edu> wrote in message
news:c2ag9f$j0t$1@prometheus.acsu.buffalo.edu...
> Is a std::vector *guaranteed* to be contiguous in memory? Bjarne
> Stroustrup says it takes constant time to access a vector element and
> that implies contiguous storage but I just wanted to double-check. I
> heard that ISO 14882 standard did not guarantee this. Has this changed?

I think this is mandated in TC1

-Mike



Relevant Pages

  • Re: Is std::vector contiguous?
    ... > Stroustrup says it takes constant time to access a vector element and ... > that implies contiguous storage but I just wanted to double-check. ... Karl Heinz Buchegger summarized the situation nicely in this post: ...
    (comp.lang.cpp)
  • Re: Is std::vector contiguous?
    ... > Stroustrup says it takes constant time to access a vector element and ... > that implies contiguous storage ... it could mean that there is an array of pointers to ...
    (comp.lang.cpp)
  • Is std::vector contiguous?
    ... Stroustrup says it takes constant time to access a vector element and ... that implies contiguous storage but I just wanted to double-check. ... heard that ISO 14882 standard did not guarantee this. ...
    (comp.lang.cpp)
  • Re: Is std::vector contiguous?
    ... > Stroustrup says it takes constant time to access a vector element ... > that implies contiguous storage but I just wanted to double-check. ... > heard that ISO 14882 standard did not guarantee this. ... From ISO 14882, 2nd ...
    (comp.lang.cpp)