I have a set of arithmetic-only functions, whose calls are not determined at the compilation but at run time. I intended to create a array of pointers to all of them, and to handle the call of them through the array indices (e.g. if (a>3) call the 3rd one).
Those functions will be called heavily and repeatedly in a loop, so they must be inlined for performance.
My question is, will such a call through inline member function pointers end up being inlined?
Thanks!
class foo{
private:
int f(int x){return x;}
int (foo::*pf)(int);
public:
foo(){
pf=&foo::f;
(*this.*pf)(3); //will this call be inlined?
f(3); //this call is surely inlined
}
};
int main(){
foo f;
return 0;
}