Clean up EIGEN_STATIC_ASSERT to only use standard c++11 static_assert.

This commit is contained in:
Rasmus Munk Larsen
2021-09-16 20:43:54 +00:00
parent 7b975acb1f
commit 6cadab6896
48 changed files with 269 additions and 663 deletions

View File

@@ -7,11 +7,20 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#define EIGEN_NO_STATIC_ASSERT
#include "main.h"
#include "random_without_cast_overflow.h"
template <typename MatrixType>
typename internal::enable_if<(MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1),void>::type
check_index(const MatrixType& m) {
VERIFY_RAISES_ASSERT(m[0]);
VERIFY_RAISES_ASSERT((m+m)[0]);
}
template <typename MatrixType>
typename internal::enable_if<!(MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1),void>::type
check_index(const MatrixType& /*unused*/) {}
template<typename MatrixType> void basicStuff(const MatrixType& m)
{
typedef typename MatrixType::Scalar Scalar;
@@ -101,8 +110,7 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
if(cols!=1 && rows!=1)
{
VERIFY_RAISES_ASSERT(m1[0]);
VERIFY_RAISES_ASSERT((m1+m1)[0]);
check_index(m1);
}
VERIFY_IS_APPROX(m3 = m1,m1);