Re: CString Array to LPCTSTR *



Thanks for the links, they tend to clarify the vector and contiguity stuff.
--
Vipin Aravind
http://www.explorewindows.com/Blogs

"Doug Harrison [MVP]" <dsh@xxxxxxxx> wrote in message
news:8jm1h2phpvpfer0thrnja1so1ubo9giu78@xxxxxxxxxx
On Wed, 20 Sep 2006 09:22:38 +0530, "Vipin" <Vipin@xxxxxxxxxx> wrote:

Actually if you look up the container summary chapter in C++ programming
language by Stroustup, it says this:-
"For vector the element data structure is most likely an array"
It never says it *is* an array because it is an underneath implementation
detail and since array provides random access that would be the most
commonly used implementation mechanism.

For many years, people have been pointing out the C++ Standard doesn't
require vector to use contiguous storage. That omission was corrected in
the TC1, which I think came out in 2003:

http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#69

As far as std::string is concerened, Stroustrup mentions two possible
implementations underneath.

There are two things that are relevant here:

1. What the standard says.
2. How people have followed the standard.

I addressed both in my first reply to this thread. But wait, there's more.
The de facto contiguity requirement of std::string will be formalized in
the next TC:

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#530

--
Doug Harrison
Visual C++ MVP


.