From ab28091fc55ab1d315083372ef75f6ccc8dfb34e Mon Sep 17 00:00:00 2001
From: ManifoldFR <wilson.jallet@polytechnique.org>
Date: Wed, 30 Nov 2022 10:38:05 +0100
Subject: [PATCH] unittest/vector.cpp

remove useless include
remove comment between includes (not sorted by pre-commit anymore)

core/std-vector.hpp
* fix using-ctor for older cpp versions
* fix warning about conversion
---
 include/eigenpy/std-vector.hpp | 11 +++++++----
 unittest/eigen_ref.cpp         |  1 -
 unittest/vector.cpp            |  5 +++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/eigenpy/std-vector.hpp b/include/eigenpy/std-vector.hpp
index e34668c2..cb6d869e 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 66249edb..9c334d10 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 7b2523a4..b45f70d0 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"
 
-- 
GitLab