C++ inline
Date: 2023-02-25Last modified: 2023-02-27
Table of contents
- Inline functions can increase the size of your application binary
- It is recommended fo use them for short, frequently used functions
- The programmer (You), should weigh in the benefits against the downsides of inlining your functions
- Usually only functions of a few lines of code and simple logic, like our max function should be inlined
- Marking your function as inline is just a suggestion to the
compiler.
- The compiler might agree and inline your function or just ignore you
func1();
func2();
Possible output