title: what is/are the purpose(s) of inline?
body: <p>I had a <a href="https://stackoverflow.com/questions/3645896/can-i-make-alias-to-singletone-function/3645900#3645900">discussion</a> with <a href="https://stackoverflow.com/users/34509/johannes-schaub-litb">Johannes Schaub</a> regarding the keyword <code>inline</code>. 
  The code there was this:</p>
  
  <pre><code>namespace ... {
      static void someFunction() {
          MYCLASS::GetInstance()-&gt;someFunction();
      }
  };
  </code></pre>
  
  <p>He stated that:</p>
  
  <blockquote>
    <p>Putting this as an inline function may
    save code size in the executable</p>
  </blockquote>
  
  <p>But according to my findings <a href="http://en.wikipedia.org/wiki/Inline_function#Language_support" rel="nofollow noreferrer">here</a> and <a href="http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx" rel="nofollow noreferrer">here</a> it wouldn't be needed, since:</p>
  
  <ul>
  <li><em>[Inline] only occurs if the compiler's cost/benefit analysis show it to be profitable</em></li>
  <li><em>Mainstream C++ compilers like Microsoft Visual C++ and GCC support an option that lets the compilers automatically inline any suitable function, even those not marked as inline functions.</em></li>
  </ul>
  
  <p>Johannes however states that there are other benefits of explicitly specifying it. Unfortunately I do not understand them. For instance, he stated that <em>And "inline" allows you to define the function multiple times in the program.</em>, which I am having a hard time understanding (and finding references to).</p>
  
  <p>So</p>
  
  <ol>
  <li>Is <code>inline</code> just a recommendation for the compiler?</li>
  <li>Should it be explicitly stated when you have a small function (I guess 1-4 instructions?)</li>
  <li>What other benefits are there with writing <code>inline</code>?</li>
  <li>is it needed to state <code>inline</code> in order to reduce the executable file size, even though the compiler (according to wikipedia [I know, bad reference]) should find such functions itself?</li>
  </ol>
  
  <p>Is there anything else I am missing?</p>