title: Why won't this compile without a default constructor?
body: <p>I can do this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int counter;
  
  int main()
  {
      struct Boo
      {
          Boo(int num)
          {
              ++counter;
              if (rand() % num &lt; 7) Boo(8);
          }
      };
  
      Boo(8);
  
      return 0;
  }
  </code></pre>
  
  <p>This will compile fine, my counter result is <strong>21</strong>. However when I try to create the <code>Boo</code> object passing the constructor argument instead of an integer literal I get a compile error:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int counter;
  
  int main()
  {
      struct Boo
      {
          Boo(int num)
          {
              ++counter;
              if (rand() % num &lt; 7) Boo(num); // No default constructor 
                                              // exists for Boo
          }
      };
  
      Boo(8);
  
      return 0;
  }
  </code></pre>
  
  <p>How is a default constructor called in the second example but not in the first example? This is error I get on Visual Studio 2017.</p>
  
  <p>On the online C++ compiler onlineGDB I get the errors:</p>
  
  <pre><code>error: no matching function for call to ‘main()::Boo::Boo()’
      if (rand() % num &lt; 7) Boo(num);
  
                             ^
  note:   candidate expects 1 argument, 0 provided
  </code></pre>