title: How do these two functions defined in the same class manage to call each other without forward declaration?
body: <p>For the time I'm learning to code with boost/asio. Many code samples make use of the combination of async_accept and bind. In the server code , i come across some thing like this:</p>
  
  <pre><code>class Tcp_server
  {
  public:
      Tcp_server()
      {
  
      }
      void start_accept(int a)
      {
          if(a&gt;0)
          {
              cout&lt;&lt;a&lt;&lt;endl;
              handle_accept(a-1);
          }
  
      }
  
      void handle_accept(int a)
      {
          if(a&gt;0)
          {
              cout&lt;&lt;a&lt;&lt;endl;
              start_accept(a-1);
          }
  
      }
  };
  </code></pre>
  
  <p>If i make an instance of Tcp_server and call either handle_accept or start accept, it works. But if I drop the Tcp_server class encapsulation, the compiler would complain  "handle_accept is not declared". I'm just wondering if the compiler automatically forward declare all the functions defined in the same class. Can anyone explain why? </p>