title: Is an object fully constructed at the end of the initialiser list?
body: <p>This is a spinoff from <a href="https://stackoverflow.com/questions/41664138/unconditionally-throw-this-from-constructor">invoking the copy constructor within the constructor</a>.</p>
  
  <p>I believe that an object is fully formed and can be expected to behave as such by the end of the initialiser list (edit: I was wrong about this though!). Specifically, member functions and accessing local state from within the constructor itself will behave exactly as they would from any other member function.</p>
  
  <p>This seems to be a slightly contentious point of view though, the alternative is that only once the constructor has returned normally is the object fully formed.</p>
  
  <p>The following is a quick &amp; dirty test case for this which shows all the member fields that are mentioned in the initialiser list being initialised and those that aren't getting default constructed.</p>
  
  <pre><code>#include &lt;cstdio&gt;
  
  struct noise
  {
    noise() { printf("noise default constructed\n"); }
    noise(int x) { printf("noise integer constructed %u\n", x); }
    ~noise() { printf("noise dtor\n"); }
  };
  
  struct invoke : public noise
  {
    noise init;
    noise body;
    invoke() : noise(3), init(4)
    {
      body = noise(5);
      throw *this; // try to use the object before returning normally
    }
    ~invoke() { printf("invoke dtor\n"); }
  };
  
  int main()
  {
    try
      {
        invoke i;
      }
    catch (...)
      {
      }
  }
  </code></pre>
  
  <p>This prints, on my machine at least,</p>
  
  <pre><code>noise integer constructed 3
  noise integer constructed 4
  noise default constructed
  noise integer constructed 5
  noise dtor
  noise dtor
  noise dtor
  noise dtor
  invoke dtor
  noise dtor
  noise dtor
  noise dtor
  </code></pre>
  
  <p>As always, it's difficult to distinguish works-as-specified from works-as-my-compiler-implemented! Is this actually UB?</p>