Use static assert

replaces compiler hacks that emulated compile-time assertions by actual static_assert. kills plenty of unused macro warnings in GCC 4.8+