title: static variable construction in C++
body: <p>How do compilers know how to correctly handle this code?</p>
  
  <pre><code>struct Foo
  {
      int bar;
  
      Foo()
      {
          bar = 3;
      }
  
      Foo&amp; operator=(const Foo&amp; other)
      {
          bar = other.bar;
          return *this;
      }
  
      int SetBar(int newBar)
      {
          return bar = newBar;
      }
  };
  
  static Foo baz;
  static Foo someOtherBaz = baz;
  static int placeholder = baz.SetBar(4);
  </code></pre>
  
  <p>What would the final value of <code>someOtherBaz.bar</code> be?</p>