pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More (Windows) Errors


From: David Philippi
Subject: Re: More (Windows) Errors
Date: Sat, 19 Oct 2002 16:48:17 +0200
User-agent: KMail/1.4.1

On Saturday 19 October 2002 11:03, David Philippi wrote:
> >     Vec::iterator i = vec.end();
> >     vec.resize(vec.size + p.vec.size ());
> >     std::copy(p.vec.rbegin(), p.vec.rend(), i);
> I'd guess that the second variant works in evey case and should be used

Correcting myself - I'm not sure what the code above does, but I guess it's 
something undefined.
The correct code is:

vec.resize(vec.size + p.vec.size());
std::copy(p.vec.rbegin(), p.vec.rend(), std::inserter(vec, vec.end()));

Bye David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]