SFML community forums
Help => General => Topic started by: dydya-stepa on February 28, 2012, 02:11:09 pm
-
should i use inline function or the compiler will take care of it?
i noticed sfml code doesn't use it a lot
-
As a general rule, leave such decisions to the compiler until you have reason not to.
-
Serapth is right. I actually never use the inline keyword unless something must be in the header because of linkage reasons.
Generally, writing function definitions in .cpp files has the following advantages:
- Changes in the implementation don't require clients to recompile
- Less code must be read everywhere the header is used, speeding up compilation progress
- Functionality on which the implementation depends can be included in the .cpp file, leading to fewer dependencies in the interface