eg:
void func(int num){ int anArray[100000]; //in C you gotta declare the array at the top if(num < 10) return; //...impl}
if num is 3, then you just wasted your time allocating all that memory for the array.
void func(int num){ int anArray[100000]; //in C you gotta declare the array at the top if(num < 10) return; //...impl}
int gUsers;
void Thread1()
{
while(gUsers)
{
//DO WORK HERE THAT DOESN'T TOUCH gUsers
}
}
quote: Anyways, var1 += var2 is actually, performance wise, better then var1 = var1 + var2, because in the first, you do 1 addition, 1 'get' and one 'set', whereas in the second, you do 1 addition, 2 'get' and one 'set'. Ok tiny performace, but if you do it 1000 times that adds up... right....
quote:
...and then, the stack is rewound to the point where the exception was thrown.
quote:
Personally I think they implemented iterators in STL very well. On another note though, I can't STAND the implementation of templates in Visual C++. I can't even put declarations and definitions in separate files, which really bothers me...
quote:
I compiled the following using VC++ (SP3):
a = a + 1;
a += 1
and both gave exactly the same code (except using diferent processor registers), when looking at the debuger''s disassembly mode:
quote: Original post by c++freak
Oh yeah, about exceptions:
[...]
exists, DX isn''t working, GL doesn''t have all the libaries, etc. that will terminate the game/app, so that any performance hit - at that point - will not matter.