Thread: Lol
View Single Post
Old 08-03-2003, 11:37 AM   #7 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
I've promised to find out more about this, so I did:

There is a difference in the interface (code) between post and pre increment operators in certain data types.
The post increment does create a temporary variable and the temp var might call the constructor of it's class for it's instance. This slows down the execution time.
So to prevent this (creating the temp variable) one should use the pre increment to make sure no un-needed constructor calls are made.

Remember that constructor calls are slow and destructor calls are even slower. Those are the basics, but always handy to to write down again .

Phew, another lesson learned .
__________________
Valmont is offline   Reply With Quote