How does inline expansion of functions affect performance?
Show answer and explanation
Inlining can remove call overhead and expose constants and control flow to further optimization, but duplicating a body can increase code size and instruction-cache pressure. The optimizer may inline a function without the inline specifier or decline to inline one that has it; the keyword's guaranteed language role is primarily to permit identical definitions across translation units under the ODR. Performance decisions should therefore be based on optimized builds and measurement, not the keyword alone.
Inlining can remove call overhead and expose constants and control flow to further optimization, but duplicating a body can increase code size and instruction-cache pressure. The optimizer may inline a function without the inline specifier or decline to inline one that has it; the keyword's guaranteed language role is primarily to permit identical definitions across translation units under the ODR. Performance decisions should therefore be based on optimized builds and measurement, not the keyword alone.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.