title: Invalid union member
body: <p>Is there a way in Visual Studio to handle non-trivial unions. The following code is running fine using <code>g++ -std=c++11</code> but VS complains:</p>
  
  <blockquote>
    <p>invalid union member -- class "Foo" has a disallowed member function</p>
  </blockquote>
  
  <p>The code is as follows:</p>
  
  <pre><code>struct Foo {
      int value;
      Foo(int inV = 0) : value(inV) {}
  };
  
  union CustomUnion {
      CustomUnion(Foo inF) : foo(inF) {}
      CustomUnion(int inB) : bar(inB) {}
      int bar;
      Foo foo;
  };
  
  int main() {
      CustomUnion u(3);
      return 0;
  }
  </code></pre>
  
  <p>Is there a way in Visual Studio to support this kind of unions (compilation option for instance)? Or should I change my code, and if so by what?</p>