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 17:17:06 +0200
User-agent: KMail/1.4.1

On Saturday 19 October 2002 11:03, David Philippi wrote:
> I'd guess that the second variant works in evey case and should be used
> without #ifdef. There shouldn't be any noticable performance difference
> between the two and while I consider the first is better style, we're
> loosing this advantage with GCC too because we have both in the code.

I should think more before writing, not only is the code wrong (see other 
mail), there's also the fact that performance does differt between the two 
solutions.
Range insert is an optimized function of vector which will probably consist 
of a resize() and a memcpy() internally while the other variant needs two 
template instatiations (std::copy, std::inserter) and uses a loop 
internally.
The best solution therefore is - probably (I'm learning *g*) - to use a 
vector_helper.hxx like the old list_helper which contains the corrected code 
with #ifdef. If this method is declared inline there should be no 
performance loss at all on GCC and we can remove it as soon as VC++ 7 get's 
more widespread. That said one could consider to change the ifdef exclude 
VC++ 7 
#if defined(WIN32) && !defined (MSVC_VER >= 7)
(Or whatever version constant is).

Bye David





reply via email to

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