GenericValue stores a T. So, it potentially has to be aligned. We check this requirement and call Eigen's aligning operator if so.

release/4.3a0
Frank Dellaert 2018-10-23 22:51:44 -04:00
parent 846a2619df
commit 9b7f80f25c
1 changed files with 8 additions and 1 deletions

View File

@ -187,6 +187,13 @@ public:
ar & boost::serialization::make_nvp("GenericValue",
boost::serialization::base_object<Value>(*this));
ar & boost::serialization::make_nvp("value", value_);
// Alignment, see https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html
enum { NeedsToAlign = (sizeof(T) % 16) == 0 };
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
}
/// use this macro instead of BOOST_CLASS_EXPORT for GenericValues