Quote Originally Posted by laserlight View Post

Maybe, maybe not. The overloaded operator() might be inlined, thus making function call overhead zero.
I concluded that from comparing the total run time of my array with that of a static 3d array using freebsd+g++. I didn't use any optimization of the compiler, just

g++ *.cpp -o myprogram

To my knowledge, inlined function is just a suggestion to compiler. No one knows whether it is inlined. I have to ensure the performance of my program. So is there any way to force the compiler to inline a specific function?