我正在尝试将 Eigen::Vector4d 传递给这样的函数:
Matrix3d quat2DCM(Vector4d quat)
{
quat = quat;
return Matrix3d::Identity();
//nevemind the guts of this function, that'l come after this works
}
VC++2005 编译器给了我以下错误:
错误 C2719: 'quat': 带有 __declspec(align('16')) 的形参不会对齐
Eigen::Vector3d 对象作为参数不会发生这种情况。我注意到,在一些在线讨论中,Vector4d 类对它的对齐特别挑剔,比其他罐装 typedef 更重要。在类中使用 Vector4d 时,我发现有必要使用EIGEN_MAKE_ALIGNED_OPERATOR_NEW
覆盖宏的宏new
是否有类似的解决方法来传递它们的参数?