Answer Posted / jeremiah
A function that is marked "inline" can also be recursive.
- The "inline" keyword on a function definition is only a
suggestion to the compiler that this function is a good
candidate for inlining. The compiler will still have the
final say if the function can be inlined or not.
- In certain cases a function cannot be inlined even if it
has the "inline" modifier:
* You use the function as a callback which requires a
pointer to the function.
* You make a recursive call to the function that has been
marked inline. In this case, the compiler can't determine
the base case for the recursive function and theirfor can't
unroll the inline function in the recursive call. Then an
external version of the function is required.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Is python better than c++?
Do you know about latest advancements in C++ ?
How would you use the functions randomize() and random()?
Const char *p , char const *p What is the difference between the above two?
What is ostream in c++?
Why struct is used in c++?
What is a list c++?
What are the two shift operators and what are their functions?
Why do we use double in c++?
What is namespace std; and what is consists of?
What is java and c++?
What is c++ stringstream?
What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero
Is sorted c++?
What is the meaning of c++?