File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,20 @@ struct reference_arg_from_python<std::vector<Type, Allocator> &>
234234
235235namespace eigenpy {
236236
237+ namespace details {
238+ // / Defines traits for the container, used in \struct StdContainerFromPythonList
239+ template <class Container >
240+ struct container_traits {
241+ // default behavior expects allocators
242+ typedef typename Container::allocator_type Allocator;
243+ };
244+
245+ template <typename _Tp, std::size_t Size>
246+ struct container_traits <std::array<_Tp, Size> > {
247+ typedef void Allocator;
248+ };
249+ }; // namespace details
250+
237251// /
238252// / \brief Register the conversion from a Python list to a std::vector
239253// /
@@ -242,6 +256,7 @@ namespace eigenpy {
242256template <typename vector_type, bool NoProxy>
243257struct StdContainerFromPythonList {
244258 typedef typename vector_type::value_type T;
259+ typedef typename details::container_traits<vector_type>::Allocator Allocator;
245260
246261 // / \brief Check if obj_ptr can be converted
247262 static void *convertible (PyObject *obj_ptr) {
You can’t perform that action at this time.
0 commit comments