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,7 +187,14 @@ public:
|
||||||
ar & boost::serialization::make_nvp("GenericValue",
|
ar & boost::serialization::make_nvp("GenericValue",
|
||||||
boost::serialization::base_object<Value>(*this));
|
boost::serialization::base_object<Value>(*this));
|
||||||
ar & boost::serialization::make_nvp("value", value_);
|
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
|
/// use this macro instead of BOOST_CLASS_EXPORT for GenericValues
|
||||||
#define GTSAM_VALUE_EXPORT(Type) BOOST_CLASS_EXPORT(gtsam::GenericValue<Type>)
|
#define GTSAM_VALUE_EXPORT(Type) BOOST_CLASS_EXPORT(gtsam::GenericValue<Type>)
|
||||||
|
|
Loading…
Reference in New Issue