Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
should i use inline functions?
Print
Pages: [
1
]
Author
Topic: should i use inline functions? (Read 1854 times)
0 Members and 1 Guest are viewing this topic.
dydya-stepa
Jr. Member
Posts: 82
should i use inline functions?
«
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
Logged
Serapth
Full Member
Posts: 105
should i use inline functions?
«
Reply #1 on:
February 28, 2012, 03:30:57 pm »
As a general rule, leave such decisions to the compiler until you have reason not to.
Logged
Nexus
SFML Team
Hero Member
Posts: 6287
Thor Developer
should i use inline functions?
«
Reply #2 on:
February 28, 2012, 08:01:53 pm »
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
Logged
Zloxx II
: action platformer
Thor Library
: particle systems, animations, dot products, ...
SFML Game Development
:
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
should i use inline functions?