For optimized coding I use the following guideline:
Inline methods that - have no loops, are non virtual, are non-recursive, are not (esp.derived) class constructors / destructors and do not make calls to virtual functions.
The important point missing here is a specification on the number of lines of code the inlined function should contain. Initially I thought I would inline only those methods that contained at most 7 lines of code. This includes the length of functions that would be called from my inlined function. Is this spec ok ? I am looking for a second opinion - may be based on some mathematics.
Cheers
Inline methods that - have no loops, are non virtual, are non-recursive, are not (esp.derived) class constructors / destructors and do not make calls to virtual functions.
The important point missing here is a specification on the number of lines of code the inlined function should contain. Initially I thought I would inline only those methods that contained at most 7 lines of code. This includes the length of functions that would be called from my inlined function. Is this spec ok ? I am looking for a second opinion - may be based on some mathematics.
Cheers