diff --git a/include/eigenpy/std-vector.hpp b/include/eigenpy/std-vector.hpp index e34668c2a0589be4418444deab30b4c4123b3e62..cb6d869e0ff4d2d84f719b33fa5d6ae37c8b352d 100644 --- a/include/eigenpy/std-vector.hpp +++ b/include/eigenpy/std-vector.hpp @@ -112,7 +112,7 @@ struct overload_base_get_item_for_std_vector bp::extract<long> i(i_); if (i.check()) { long index = i(); - if (index < 0) index += container.size(); + if (index < 0) index += (long)container.size(); if (index >= long(container.size()) || index < 0) { PyErr_SetString(PyExc_IndexError, "Index out of range"); bp::throw_error_already_set(); @@ -158,7 +158,8 @@ struct extract<Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> MatrixType; typedef extract_to_eigen_ref<MatrixType> base; - using base::base; + extract(PyObject *o) : base(o) {} + extract(api::object const &o) : base(o.ptr()) {} }; template <typename Derived> @@ -166,7 +167,8 @@ struct extract<Eigen::MatrixBase<Derived> &> : extract_to_eigen_ref<Eigen::MatrixBase<Derived> > { typedef Eigen::MatrixBase<Derived> MatrixType; typedef extract_to_eigen_ref<MatrixType> base; - using base::base; + extract(PyObject *o) : base(o) {} + extract(api::object const &o) : base(o.ptr()) {} }; template <typename Derived> @@ -174,7 +176,8 @@ struct extract<Eigen::RefBase<Derived> &> : extract_to_eigen_ref<Eigen::RefBase<Derived> > { typedef Eigen::RefBase<Derived> MatrixType; typedef extract_to_eigen_ref<MatrixType> base; - using base::base; + extract(PyObject *o) : base(o) {} + extract(api::object const &o) : base(o.ptr()) {} }; namespace converter { diff --git a/unittest/eigen_ref.cpp b/unittest/eigen_ref.cpp index 66249edbfb11cfd20dc93be976adffa1850bc1bb..9c334d10bbb748ed0bd21f94c6580f6787b3dd3e 100644 --- a/unittest/eigen_ref.cpp +++ b/unittest/eigen_ref.cpp @@ -6,7 +6,6 @@ #include <iostream> #include "eigenpy/eigenpy.hpp" -// include main header first #include "eigenpy/eigen-from-python.hpp" using namespace Eigen; diff --git a/unittest/vector.cpp b/unittest/vector.cpp index 7b2523a4ed88a136cd38aa008debf830f21aedb9..b45f70d0496dfb1d1d78839bf170c27d92a96c33 100644 --- a/unittest/vector.cpp +++ b/unittest/vector.cpp @@ -1,8 +1,9 @@ +/// @file +/// @copyright Copyright 2022, CNRS +/// @copyright Copyright 2022, INRIA #include <ostream> -#include <type_traits> #include "eigenpy/eigenpy.hpp" -// include main first #include "eigenpy/eigen-from-python.hpp" #include "eigenpy/std-vector.hpp"