title: C++ template and inline
body: <p>When I'm writing a simple (non-template) class, if the function implementation is provided "right in place", it's automatically treated as <code>inline</code>.</p>
  
  <pre><code>class A {
     void InlinedFunction() { int a = 0; }
     // ^^^^ the same as 'inline void InlinedFunction'
  }
  </code></pre>
  
  <p>What about this rule when talking about template-based classes?</p>
  
  <pre><code>template &lt;typename T&gt; class B {
     void DontKnowFunction() { T a = 0; }
     // Will this function be treated as inline when the compiler
     // instantiates the template?
  };
  </code></pre>
  
  <p>Also, how is the <code>inline</code> rule applied to non-nested template functions, like </p>
  
  <pre><code>template &lt;typename T&gt; void B::DontKnowFunction() { T a = 0; }
  
  template &lt;typename T&gt; inline void B::DontKnowFunction() { T a = 0; }
  </code></pre>
  
  <p>What would happen in the first and in the second case here?</p>
  
  <p>Thank you.</p>