Re: [GD-General] not sure where to post this question... bit C++ =?windows-1252?q?=09implementation?
Brought to you by:
vexxed72
From: Noel L. <nl...@co...> - 2004-07-07 15:19:20
|
On Wednesday 07 July 2004 07:05 am, Richard Fabian wrote: > its actually more of a "didn't want to have to dereference everytime i > needed to access the array". speed issue... You do realize that, at least on a PC, it's just as fast accessing an array on the stack than one that was dynamically allocated, right? Actually, if you're accessing more than one int at the time, the dynamically-allocated one might be faster because of better memory alignment. And if you're talking about the extra indirection added by boost::scoped_array... I admit I haven't measured, but I doubt very, very much you would notice any difference unless all your program did was run in a for loop accessing array elements. > The best fix in our situation will be to use defines as far as i can > see. Personally, I see nothing wrong with simple defines for things like that. It's when you start doing complicated macros that the pre-processor can become more of a problem than it solves. --Noel Games from Within http://www.gamesfromwithin.com |