Archived

This topic is now archived and is closed to further replies.

Digital Extent

Inline functions

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites