This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 742

Summary: Replace EIGEN_STATIC_ASSERTION by a true static assertion
Product: Eigen Reporter: Christoph Hertzberg <chtz>
Component: Core - generalAssignee: Nobody <eigen.nobody>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: gael.guennebaud, jacob.benoit.1
Priority: Normal    
Version: 3.2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 558    

Description Christoph Hertzberg 2014-02-12 13:29:04 UTC
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.
Comment 1 Gael Guennebaud 2014-02-13 09:42:49 UTC
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.
Comment 2 Gael Guennebaud 2014-10-20 13:54:18 UTC
Wontfix as this would break our current unit tests.
Comment 3 Nobody 2019-12-04 13:00:28 UTC
-- 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.