title: Why does the compiler complain about the alignment?
body: <p>I'd like to understand more about alignment. Why does the Microsoft compiler (Visual Studio 2012 Express) complain about the alignment for the following snippet of code?</p>
  
  <pre><code>__declspec(align(16)) class Foo
  {
  public:
      virtual ~Foo() {}
      virtual void bar() = 0;
  };
  </code></pre>
  
  <p>This is the warning the compiler presents to me:</p>
  
  <pre><code>warning C4324: 'Foo' : structure was padded due to __declspec(align())
  </code></pre>
  
  <p>It does not even matter whether or not the class has any virtual methods. Even for an empty class the compiler complains with the same warning message. How is an empty class aligned? How does the compiler pad this class?</p>