title: C++ inline member function in .cpp file
body: <p>I know that inline member functions by definition should go into the header. But what if it's not possible to put the implementation of the function into the header? Let's take this situation:</p>
  
  <p>File A.h</p>
  
  <pre><code>#pragma once
  #include "B.h"
  
  class A{
      B b;
  };
  </code></pre>
  
  <p>File B.h</p>
  
  <pre><code>#pragma once
  
  class A; //forward declaration
  
  class B{
      inline A getA();
  };
  </code></pre>
  
  <p>Due to the circular include I have to put the implementation of <code>getA</code> into</p>
  
  <p>B.cpp</p>
  
  <pre><code>#include "B.h"
  #include "A.h"
  
  inline A B::getA(){
      return A();
  }
  </code></pre>
  
  <p>Will the compiler inline <code>getA</code>? If so, which inline keyword is the significant one (the one in the header or the one in the .cpp file)? Is there another way to put the definition of an inline member function into its .cpp file?</p>