In what scenario might the compiler ignore the inline keyword for a function?
- If the function has recursion.
- If the function is a template.
- If the function is defined outside the class.
- If the function uses a single return statement.
The inline keyword is a suggestion to the compiler, not a command. While compilers use their heuristics to decide, functions with recursion are typically not inlined because inlining recursive functions can lead to significant code bloat and possible stack overflow issues.
Loading...
Related Quiz
- Which keyword is used to define a function in C++?
- Which keyword is used to catch exceptions in C++?
- What is the effect of the continue statement inside a for loop?
- In C++, an abstract class can have a mix of abstract as well as _______ methods.
- In binary file operations, to write data of various data types, you use the _______ function.