Inline functions

Started by
2 comments, last by Digital Extent 21 years, 3 months ago
Just wonder, how often do you use inline functions. And if you do, what is the specific reason?
Programming is easy, thinking is hard.
Advertisement
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.
It's not what you're taught, it's what you learn.
Can the compiler recognize inline functions if they are declared in the .cpp file compiled into a .lib file?
Programming is easy, thinking is hard.
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?

This topic is closed to new replies.

Advertisement