title: Is the address of the first data member of an instance the same as the address of the instance?
body: <pre><code>class Foo {
      public:
          int a;
          int b;
  };
  
  Foo x;
  bool sameAddress =  (void*)&amp;x  ==  (void*)&amp;(x.a);
  </code></pre>
  <p>I have not yet come across a compiler/architecture for which <code>sameAddress</code> is false, but I have only looked at about 6 different variants.  Is this defined or undefined?  Does it depend on whether <code>std::is_standard_layout&lt;Foo&gt;::value</code> is true (and/or other aspects of the class definition)?  Does <code>#pragma pack( push, 1 )</code> help in guaranteeing it?</p>