Implement better static assertion checking to make sure that the first assertion is a static one and not a runtime one.

This commit is contained in:
Gael Guennebaud
2018-03-09 10:00:51 +01:00
parent d820ab9edc
commit f6be7289d7
3 changed files with 40 additions and 6 deletions

View File

@@ -24,6 +24,7 @@
*
*/
#ifndef EIGEN_STATIC_ASSERT
#ifndef EIGEN_NO_STATIC_ASSERT
#if EIGEN_MAX_CPP_VER>=11 && (__has_feature(cxx_static_assert) || (defined(__cplusplus) && __cplusplus >= 201103L) || (EIGEN_COMP_MSVC >= 1600))
@@ -132,7 +133,7 @@
#define EIGEN_STATIC_ASSERT(CONDITION,MSG) eigen_assert((CONDITION) && #MSG);
#endif // EIGEN_NO_STATIC_ASSERT
#endif // EIGEN_STATIC_ASSERT
// static assertion failing if the type \a TYPE is not a vector type
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE) \