POV-Ray : Newsgroups : povray.off-topic : New NearInfinity demo up : Re: New NearInfinity demo up Server Time
6 Sep 2024 21:21:50 EDT (-0400)
  Re: New NearInfinity demo up  
From: Darren New
Date: 15 Dec 2008 19:28:33
Message: <4946f631$1@news.povray.org>
Warp wrote:
> std::vector<hgeSprite> tile;
> 
> tile.reserve(8*8);
> for(...)
>   for(...)
>     tile.push_back(hgeSprite(...));

Not that I'd recommend micro-optimization over readability, but isn't this 
going to be more inefficient than the other way? Doesn't this allocate a 
sprite on the stack, pass it to tile.push_back(), which then has to copy it 
to dynamically allocated memory anyway?

-- 
   Darren New, San Diego CA, USA (PST)
   The NFL should go international. I'd pay to
   see the Detroit Lions vs the Roman Catholics.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.