title: Why doesn't sizeof parse struct members?
body: <p>I know that <code>sizeof</code> is a compile-time calculation, but this seems odd to me:  The compiler can take either a type name, or an expression (from which it deduces the type).  But how do you identify a type within a class?  It seems the only way is to pass an expression, which seems pretty clunky.</p>
  
  <pre><code>struct X { int x; };
  int main() {
      // return sizeof(X::x); // doesn't work
      return sizeof(X()::x); // works, and requires X to be default-constructible
  }
  </code></pre>