Use static assertions to test structure size.

As you seem to be using c++11, I added static_assertions, a feature of c++11.
There is a version of static assert for C too, and for non-c++11 in clang: _Static_assert, if you are interested.

I think using static assertions to assert struct sizes is safe than using runtime assertions, or no assertions at all.