3 ms·
These machinations were always necessary to get compile-time asserts. Luckily C++11 and C11 are both providing static_assert so there will be real compiler supp
by apaprocki 15y ago
These machinations were always necessary to get compile-time asserts. Luckily C++11 and C11 are both providing static_assert so there will be real compiler support instead of having to trick it into dumping an error.
edit: Another common one is using __LINE__ or __COUNTER__ in an array symbol name and having the test value result in an array size of -1.