Skip to content

Commit 44e2f48

Browse files
committed
core: fix compatibility with Boost.Python >= 1.77
1 parent f486537 commit 44e2f48

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

include/eigenpy/eigen-from-python.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ namespace eigenpy
4141
struct referent_storage_eigen_ref
4242
{
4343
typedef Eigen::Ref<MatType,Options,Stride> RefType;
44-
44+
#if BOOST_VERSION / 100 % 1000 >= 77
45+
typedef typename aligned_storage<
46+
::boost::python::detail::referent_size<RefType&>::value,
47+
::boost::alignment_of<RefType&>::value
48+
>::type type;
49+
#else
4550
typedef ::boost::python::detail::aligned_storage<
4651
::boost::python::detail::referent_size<RefType&>::value
4752
> AlignedStorage;
53+
#endif
4854

4955
referent_storage_eigen_ref()
5056
: pyArray(NULL)
@@ -93,14 +99,22 @@ namespace boost { namespace python { namespace detail {
9399
struct referent_storage<Eigen::Ref<MatType,Options,Stride> &>
94100
{
95101
typedef ::eigenpy::details::referent_storage_eigen_ref<MatType,Options,Stride> StorageType;
102+
#if BOOST_VERSION / 100 % 1000 >= 77
103+
typedef typename aligned_storage<referent_size<StorageType&>::value>::type type;
104+
#else
96105
typedef aligned_storage<referent_size<StorageType&>::value> type;
106+
#endif
97107
};
98108

99109
template<typename MatType, int Options, typename Stride>
100110
struct referent_storage<const Eigen::Ref<const MatType,Options,Stride> &>
101111
{
102112
typedef ::eigenpy::details::referent_storage_eigen_ref<const MatType,Options,Stride> StorageType;
113+
#if BOOST_VERSION / 100 % 1000 >= 77
114+
typedef typename aligned_storage<referent_size<StorageType&>::value, alignment_of<StorageType&>::value>::type type;
115+
#else
103116
typedef aligned_storage<referent_size<StorageType&>::value> type;
117+
#endif
104118
};
105119
#endif
106120
}}}

0 commit comments

Comments
 (0)