title: If I declare and define a function inside the header file, does it matter to make the function inline?
body: <p>I am inside <code>struct T { ... };</code>. If I declare and define a function inside the header file, does it matter if I make the function <code>inline</code>? I mean, isn't it by default considered <code>inline</code> in this case? It seems <code>inline</code> is more of a suggestion to the compiler. So maybe, in this case, all it means is a stronger suggestion (?) Does your answer depend on whether or not the function is actually a template function?</p>
  <p>EDIT:
  Here are a few related quotes from <a href="https://en.cppreference.com/w/cpp/language/inline" rel="nofollow noreferrer">C++ Referece</a>:</p>
  <p>According to the following quote, the <strong>original</strong> intent of the <code>inline</code> was as I said it here. Not sure when/if it is changed, and if/how I can the original meaning back.</p>
  <blockquote>
  <p>The original intent of the inline keyword was to serve as an indicator to the optimizer that inline substitution of a function is preferred over function call, that is, instead of executing the function call CPU instruction to transfer control to the function body, a copy of the function body is executed without generating the call. This avoids overhead created by the function call (passing the arguments and retrieving the result) but it may result in a larger executable as the code for the function has to be repeated multiple times.</p>
  </blockquote>
  <p>According to the following quote, <code>inline</code> only <strong>suggests</strong> something to the compiler.</p>
  <blockquote>
  <p>Since this meaning of the keyword inline is non-binding, compilers are free to use inline substitution for any function that's not marked inline, and are free to generate function calls to any function marked inline. Those optimization choices do not change the rules regarding multiple definitions and shared statics listed above.</p>
  </blockquote>
  <p>So if in the current C++ Standard, <code>inline</code> means something else, how can I suggest to the compiler to inline an implementation (with the inline meaning that I quoted above).</p>