Well, does it?
This is a discussion on Does it make anyy difference if a function is "inline" within the C++ Programming forums, part of the General Programming Boards category; Well, does it?...
Well, does it?
Well english isn't my first language, (it's instead a useless language called danish which only 5 milion people speak!!) so if you think my grammar SUCKS (it does by the way) than you're more then welcome to correct me.
Hell I might even learn something
It helps in speed-critical procedures, sometimes. Essentially, IF your compiler actually makes the function inline (declaring it inline does NOT force the compiler to actually make it inline, it's more of a suggestion) you save a slight bit of time and memory by removing the overhead that goes with a procedure call.
The only place you'd notice any difference would be in functions that are called repeatedly, and with machines getting faster and faster, instruction caches getting more intelligent and doing branch prediction, etc., the overhead to call a function is getting proportionally smaller and smaller.
inline does not only remove overhead to function calls, it also allows the compiler to make more sophisticated optimizations based on larger lengths of code generated by inlining a function.
Just a question, what would happen with an inline recursive function?
Those who live by the sword get shot by those who don't.
I can C.
p.s. What the alphabet would look like without q and r.
"Does it make anyy difference if a function is "inline""
No, of course not. It's just a fancy trick to impress your friends.