diff --git a/include/eigenpy/details.hpp b/include/eigenpy/details.hpp
index 9a5bddf729ffc696d5509ac1908ec260b1e97c12..9a43df4b7389fbf22ada994408c50a8f3f858fe6 100644
--- a/include/eigenpy/details.hpp
+++ b/include/eigenpy/details.hpp
@@ -29,6 +29,13 @@ namespace boost { namespace python { namespace detail {
           std::size_t, value = sizeof(MatType));
   };
 
+  template<class MatType>
+  struct referent_size<Eigen::MatrixBase<MatType> >
+  {
+      BOOST_STATIC_CONSTANT(
+          std::size_t, value = sizeof(MatType));
+  };
+
   template<class MatType>
   struct referent_size<Eigen::EigenBase<MatType>&>
   {
@@ -36,6 +43,13 @@ namespace boost { namespace python { namespace detail {
           std::size_t, value = sizeof(MatType));
   };
 
+  template<class MatType>
+  struct referent_size<Eigen::EigenBase<MatType> >
+  {
+      BOOST_STATIC_CONSTANT(
+          std::size_t, value = sizeof(MatType));
+  };
+
 }}}
 
 namespace eigenpy