c++ - When should I use inline functions? -
possible duplicate:
when should write keyword 'inline' function/method?
i have question inline functions in c++. know inline functions used replace each apperance inline function body. not know when use it. said inline functions can improve performance, when should consider using inline function?
inline functions best small stubs of code performance-critical , reused everywhere, mundane write.
however, use them split code, rather having 1000-line long function, may end splitting couple of 100-line long methods. inline these have same effect 1000-line long method.
modern compilers automatically inline of smaller methods, can manually inline ones bigger.
there many resources this, example:
Comments
Post a Comment