title: ABI compatibility preservation with C++11 `enum class`
body: <p>This is pretty much the same question as <a href="https://stackoverflow.com/questions/27300561/does-adding-enumerators-into-enum-break-abi">Does adding enumerators into enum break ABI?</a>, but with <code>enum class</code> introduced by C++11.</p>
  
  <p>For what I understand by <a href="https://en.cppreference.com/w/cpp/language/enum" rel="nofollow noreferrer">this page</a> I can simply have a stable ABI by defining an <em>underlying type</em> for my enumerative:</p>
  
  <pre><code>enum class Foo : uint32_t
  {
      x, y, z
  }
  </code></pre>
  
  <p>I would say this works fine, as for instance something like</p>
  
  <pre><code>enum class Foo : uint8_t { x = 257 }
  </code></pre>
  
  <p>Will not compile.  This implies that the compiler is no longer silently changing the size of my enumerative, thus I don't end up in breaking binary compatibility.</p>
  
  <p>Am I correct?</p>