mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Compile- and run-time assertions for the construction of Ref<const>.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
59b3ef5409
commit
d8f3eb87bf
16
failtest/ref_7.cpp
Normal file
16
failtest/ref_7.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "../Eigen/Core"
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
void call_ref(Ref<const Matrix3f, 0, OuterStride<2>>) {}
|
||||
|
||||
int main() {
|
||||
MatrixXf a(6, 2);
|
||||
Map<const Matrix3f, 0, OuterStride<Dynamic>> md(a.data(), OuterStride<Dynamic>(2));
|
||||
Map<const Matrix3f, 0, OuterStride<2>> m2(a.data());
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
call_ref(md);
|
||||
#else
|
||||
call_ref(m2);
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user