This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 742 - Replace EIGEN_STATIC_ASSERTION by a true static assertion
Summary: Replace EIGEN_STATIC_ASSERTION by a true static assertion
Status: RESOLVED WONTFIX
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: All All
: Normal enhancement
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3.3
  Show dependency treegraph
 
Reported: 2014-02-12 13:29 UTC by Christoph Hertzberg
Modified: 2019-12-04 13:00 UTC (History)
2 users (show)



Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.