By default, if you declare and define a function inside a class, it will be inline. Inline is a request to the compiler, and the compiler decides whether it will be inline or not. In the case of inline, the function body is expanded in the code in which it was called. If the function is large and has several loops and switches, then the compiler ignores the built-in request and treats it as a simple function. A simple way to embed behavior is the same as preprocessors, but the pros and cons are different.
source share