Fix EIGEN_NO_AUTOMATIC_RESIZING not resizing empty destinations

libeigen/eigen!2219

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
Rasmus Munk Larsen
2026-02-26 07:54:27 -08:00
parent 064d686c57
commit 1b1b7e347d
5 changed files with 112 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ EIGEN_STRONG_INLINE DstXprType& copy_using_evaluator(const PlainObjectBase<DstXp
eigen_assert((dst.size() == 0 || (IsVectorAtCompileTime ? (dst.size() == src.size())
: (dst.rows() == src.rows() && dst.cols() == src.cols()))) &&
"Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
if (dst.size() == 0) dst.const_cast_derived().resizeLike(src.derived());
#else
dst.const_cast_derived().resizeLike(src.derived());
#endif