Add C++17 structured bindings support for fixed-size Matrix and Array

libeigen/eigen!2336

Closes #2247
This commit is contained in:
Pavel Guzenfeld
2026-04-19 01:17:14 -07:00
committed by Rasmus Munk Larsen
parent 5da2b96696
commit 3850ca89b3
8 changed files with 437 additions and 0 deletions
@@ -0,0 +1,16 @@
#include "../Eigen/Core"
// Reproduces the "Dynamic-sized Array breaks tuple_size" bug: the Array
// specialization had the same enable_if_t base-clause issue as Matrix. Compile
// must fail for ArrayXd.
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define ROWS Eigen::Dynamic
#define COLS Eigen::Dynamic
#else
#define ROWS 3
#define COLS 1
#endif
#include <tuple>
int main() { return static_cast<int>(std::tuple_size<Eigen::Array<double, ROWS, COLS>>::value); }