Skip to main content
gamedev.net
🔒 Locked

inline, forceinline, ...

Started by ArnoAtWork Mar 22, 2003 at 2:20 AM 1 replies 250+ views
Original Post
ArnoAtWork
ArnoAtWork
I know the word inline and what is doing, but what is exactly the limit number of instructions accepted by inline? Do we have to use only basic instructions? Can we call another function? And if the compiler accepts or not to pass a function inline, what the interest to force it using forceinline?
Kylotan
Kylotan
The inline keyword is just a guide to the compiler, and therefore an accurate answer can only really be given by your individual compiler''s documentation. Generally a compiler will happily inline a function for you when the amount of code involved in passing parameters and the return value are signifiant compared to the amount of code inside the function.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
daerid
daerid
If you use visual studio, you can set what inline, __inline, and __forceinline do.
daerid@gmail.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.