File tree Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2023 CNRS INRIA
2+ * Copyright 2014-2024 CNRS INRIA
33 */
44
55#ifndef __eigenpy_fwd_hpp__
7373#include < boost/python.hpp>
7474#include < boost/python/scope.hpp>
7575
76+ #include < type_traits>
77+ #include < utility>
78+
7679namespace eigenpy {
7780
7881namespace bp = boost::python;
@@ -167,6 +170,22 @@ struct get_eigen_ref_plain_type<Eigen::TensorRef<TensorType> > {
167170 typedef TensorType type;
168171};
169172#endif
173+
174+ namespace internal {
175+ template <class T1 , class T2 >
176+ struct has_operator_equal_impl {
177+ template <class U , class V >
178+ static auto check (U *) -> decltype(std::declval<U>() == std::declval<V>());
179+ template <typename , typename >
180+ static auto check (...) -> std::false_type;
181+
182+ using type = typename std::is_same<bool , decltype (check<T1, T2>(0 ))>::type;
183+ };
184+ } // namespace internal
185+
186+ template <class T1 , class T2 = T1>
187+ struct has_operator_equal : internal::has_operator_equal_impl<T1, T2>::type {};
188+
170189} // namespace eigenpy
171190
172191#include " eigenpy/alignment.hpp"
Original file line number Diff line number Diff line change @@ -319,24 +319,9 @@ struct StdContainerFromPythonList {
319319
320320namespace internal {
321321
322- template <typename T>
323- struct has_operator_equal
324- : boost::mpl::if_<typename boost::is_base_of<Eigen::EigenBase<T>, T>::type,
325- has_operator_equal<Eigen::EigenBase<T> >,
326- boost::true_type>::type {};
327-
328- template <typename T, class A >
329- struct has_operator_equal <std::vector<T, A> > : has_operator_equal<T> {};
330-
331- template <>
332- struct has_operator_equal <bool > : boost::true_type {};
333-
334- template <typename EigenObject>
335- struct has_operator_equal <Eigen::EigenBase<EigenObject> >
336- : has_operator_equal<typename EigenObject::Scalar> {};
337-
338- template <typename T, bool has_operator_equal_value = boost::is_base_of<
339- boost::true_type, has_operator_equal<T> >::value>
322+ template <typename T,
323+ bool has_operator_equal_value =
324+ std::is_base_of<std::true_type, has_operator_equal<T> >::value>
340325struct contains_algo ;
341326
342327template <typename T>
You can’t perform that action at this time.
0 commit comments