title: How to force empty base optimization in MSVC when having multiple empty bases
body: <p>I have the following (simplified) code:</p>
  <pre><code>template &lt;typename T&gt;
  class Crtp1 {};
  template &lt;typename T&gt;
  class Crtp2 {};
  
  class C : public Crtp1&lt;C&gt;
          , public Crtp2&lt;C&gt;
  {
     double d{};
     bool b{};
  };
  
  static_assert(sizeof(double) == 8);
  static_assert(sizeof(C) == 16);
  </code></pre>
  <p><a href="https://compiler-explorer.com/z/zx36r6" rel="nofollow noreferrer">Code at compiler-explorer</a></p>
  <p>As you can see, I have 2 empty base classes that use CRTP in order to add functions to this class. (Omitted in this example) As far as I'm aware, there is something called an empty base class optimization, which makes me expect that there ain't a memory impact of these bases.</p>
  <p>If you compile the code with clang on Linux, this nicely does as expected, see the compiler-explorer as the static assert is accepted. However, the exact same code with MSVC 2019 takes 24 bytes instead of 16 bytes.</p>
  <p>My question, preferably using C++17, however, I also accept C++20 answers, including the use of [[no_unique_address]]:</p>
  <ul>
  <li>How can I force empty base optimization on this example?</li>
  </ul>