stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Chariton <chari...@roguewave.com>
Subject RE: Problem with vectors and insert
Date Mon, 15 May 2006 17:44:14 GMT
When using std::vector::insert my understanding is that we should be able to
insert either a single item or a group of elements.

So, using the sample code I used to illustrate this problem, I should be
able to add another item to that vector (vector b), and then insert that
vector at the front of the first vector (vector a).   Is this correct?

Example:

Vector a:  1,2,3,4
Vector b:  0,5

a.insert(a.begin(), b.begin(), b.end());

I am assuming the result should be 0,5,1,2,3,4

Is this correct?

Craig Chariton

-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Friday, May 12, 2006 4:55 PM
To: stdcxx-dev@incubator.apache.org
Subject: Re: Problem with vectors and insert

Craig Chariton wrote:
> Jira issue STDCXX-179 created.

Thanks!
Martin

> 
> Craig Chariton
> 
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Friday, May 12, 2006 4:29 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: Problem with vectors and insert
> 
> Craig Chariton wrote:
> 
>>There is an interesting problem that occurs with vectors.  Here is the
>>sample code:
> 
> [...]
> 
>>I have not been able to find any references to such a problem with
>>vectors
>>on the lists or in JIRA.  Has this problem been recognized and solved?
> 
> 
> AFAIK, it's not a known issue. Could you please open an issue
> in Jira and cross-refernce this thread? Thanks for pointing it
> out!
> 
> Martin

Mime
View raw message