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
Does c++ support exception handling?
What is the difference between a pointer and a link in c ++?
Explain public, protected, private in c++?
What do you mean by translation unit?
How do you flush std cout?
What is nested class in c++?
Are vectors passed by reference c++?
What is a c++ object?
Differentiate between a constructor and a destructor in c++.
What is void pointer in c++ with example?
How to give an alternate name to a namespace?
Why #include is used?
What is private, public and protected inheritance?
Why struct is used in c++?
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?