Inline functions
Just wonder, how often do you use inline functions. And if you do, what is the specific reason?
The compiler will attempt to assemble the program such that the function executes and returns its results without an actual function call, instead working the function code into the block where it is being called.
Which speeds up execution (one reason), but also increases the size of your executable.
How often? As often as the above reason is important enough to make use of it.
Which speeds up execution (one reason), but also increases the size of your executable.
How often? As often as the above reason is important enough to make use of it.
Can the compiler recognize inline functions if they are declared in the .cpp file compiled into a .lib file?
the inline function must be declared in the .h (that says microsoft in vc++ 6.0)
you should use inline functions in small functions that you call very often; a good example is a get/setValue in a class.
inline void Class::getState(){
return state}
you get the point. don''t you?
you should use inline functions in small functions that you call very often; a good example is a get/setValue in a class.
inline void Class::getState(){
return state}
you get the point. don''t you?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement