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
Differentiate between late binding and early binding. What are the advantages of early binding?
What is the type of 'this' pointer? When does it get created?
What is the main purpose of overloading operators?
What is null pointer and void pointer and what is their use?
Define friend function.
Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)
What is constructor c++?
Which bit wise operator is suitable for putting on a particular bit in a number?
What is token c++?
what is VOID?
What is a storage class?
What is polymorphism and its type in c++?
Which software is used to run c++ program?
Is c++ double?
How would perform Pattern Matching in C++?