Currently EIGEN_STATIC_ASSERT must be placed in code which is actually executed. For some assertions such checking template parameters this makes it necessary to be called from all constructors. BOOST_STATIC_ASSERT essentially makes a typedef which does not compile if the condition is false: http://www.boost.org/doc/libs/1_55_0/boost/static_assert.hpp This can be put anywhere inside a class and (I assume) it is guaranteed to not produce instructions regardless of optimization options.
There is one advantage of our limited mechanism: we can turn static assertions to runtime ones for unit testing. It is also simpler: the boost version need a lot of tweaking for each compiler.
Wontfix as this would break our current unit tests.
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/742.