In Fili's example above, I still don't see the advantage of adding "inline"...would not the very same result occur without the "inline" there?
Edit: By "above", I mean on the previous page, 6 posts up from the bottom
In Fili's example above, I still don't see the advantage of adding "inline"...would not the very same result occur without the "inline" there?
Edit: By "above", I mean on the previous page, 6 posts up from the bottom
all functions will generate the same results whether or not they are inline it is there to help with optimization. You should use a profiler and see if it would help to make a function inline.
ok think of inline like this basically insted of calling that function the compiler puts the code there instead eg.
actully would be this this(correct me if im wrong)Code:#include <iostream> using namespace std; inline void foo() { cout<<"Foo action"; } int main() { foo(); return 0; }
Code:#include <iostream> using namespace std; inline void foo() { cout<<"Foo Action"; } int main() { cout<<"Foo Action"//used to be foo(); return 0; }
Woop?