New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 742 - Replace EIGEN_STATIC_ASSERTION by a true static assertion
Summary: Replace EIGEN_STATIC_ASSERTION by a true static assertion
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: All All
: Normal enhancement
Assignee: Nobody
Depends on:
Blocks: 3.3
  Show dependency treegraph
Reported: 2014-02-12 13:29 UTC by Christoph Hertzberg
Modified: 2014-10-20 13:54 UTC (History)
2 users (show)


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:

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.

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