[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Patch: auto_ptr is frequently abused in TSVN code

From: Stefan Fuhrmann <stefanfuhrmann_at_alice-dsl.de>
Date: Fri, 28 Aug 2009 00:21:42 +0200

Stefan Küng <tortoisesvn_at_gmail.com> wrote:

> On 27.08.2009 16:28, Stefan Fuhrmann wrote:
> > Is there any guarantee that at least for the standard allocator
> > &v[0]+1 is equivalent to&v[1] ? In other words, does the
> > standard define that std::vector<> allocates a single,
> > contiguous block of objects with the same alignment then
> > new[] does?
> Yes, std::vector<> allocates a single, continuous block as defined in
> the C++ standard. If you want an array with a non continuous block
> (e.g., to avoid problems if memory is too fragmented already and there
> simply is no continuous block big enough available), you have to use
> std::dequeue<>.

I wasn't aware that vector<> guarantees pointer arithmetics
for all types except bool. Seems that I became too suspicious
over time.

So, apologies to Dmitry.

-- Stefan^2.


To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-08-28 00:21:55 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.