title: Allocation as default initialization
body: <p>Say I have a <code>struct</code> (or class) with a dynamic array, its length, and a constructor:</p>
  
  <pre><code>struct array {
      int l;
      int* t;
      array(int length);
  };
  
  array::array(int length) {
      l=length;
      t=new int[l];
  }
  </code></pre>
  
  <p>I assume everything so far is legal: this is how I would write it (although it maybe not be the only way to do things), but I have seen the following code, that somewhat seems to work:</p>
  
  <pre><code>struct array {
      int l;
      int* t = new int[l];
      array(int length);
  }
  
  array::array(int length) {
      l=length;
  }
  </code></pre>
  
  <p>It looks bad, so I wonder if this works out of sheer luck and undefined behaviors, or if there is some internal rule that makes this code work fine. </p>