GenericValue stores a T. So, it potentially has to be aligned. We check this requirement and call Eigen's aligning operator if so.
parent
846a2619df
commit
9b7f80f25c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue