Archived

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

Inline Keyword

This topic is 6010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It basically tries to insert the "inline"''d function into the position of the code from where it was called. This basically works somewhat like a macro... In all, this speeds up the code by removing a function call completely (though, it may slow it back down later during the funciton, depending on what you are doing in the inlined function).

I tnd to inline all of the short functions that just do trivial things.

-Chris Bennett of Dwarfsoft - The future of RPGs Thanks to all the goblins in the GDCorner niche

Share this post


Link to post
Share on other sites
if I''m not mistaken, the inline keyword just gives hints to the compiler that you want the function inlined. Thus, it is up ot the compiler whether it wants to inline the function or not.

In MSVC to force the compiler to inline code, use __inline. Don''t know if this is portable to other compiler....

Share this post


Link to post
Share on other sites
u can also inline using the compiler directive
#pragma auto_inline(on) to inline all your functions which can be inlined

{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites