Fix: MSVC ICE in MatBase stream output operator #119982

Merged
Jesse Yurkovich merged 1 commits from deadpin/blender:fix-msvcice into main 2024-03-28 19:31:30 +01:00
1 changed files with 5 additions and 4 deletions

View File

@ -470,21 +470,22 @@ struct alignas(Alignment) MatBase : public vec_struct_base<VecBase<T, NumRow>, N
friend std::ostream &operator<<(std::ostream &stream, const MatBase &mat)
{
stream << "(\n";
unroll<NumRow>([&](auto i) {
for (int i = 0; i < NumRow; i++) {
stream << "(";
unroll<NumCol>([&](auto j) {
for (int j = 0; j < NumCol; j++) {
/** NOTE: j and i are swapped to follow mathematical convention. */
stream << mat[j][i];
if (j < NumCol - 1) {
stream << ", ";
}
});
}
stream << ")";
if (i < NumRow - 1) {
stream << ",";
}
stream << "\n";
});
}
stream << ")\n";
return stream;
}