title: Compile-time Base class pointer offset to Derive class
body: <pre><code>class Base1 {
      int x;
  };
  class Base2 {
     int y;
  };
  class Derive : public Base1, public Base2 {
  public:
      enum {
          PTR_OFFSET = ((int) (Base2*)(Derive*)1) - 1,
      };
  };
  </code></pre>
  
  <p>But the compiler complains </p>
  
  <blockquote>
    <p>expected constant expression</p>
  </blockquote>
  
  <p>Everyone knows that the expression values 4 except the compiler, what goes wrong?
  <p>How, then, to get the offset at compile time?</p>