From 6e9184b6f82e99a5095b5812a4b6b7040f87d17d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 27 Jul 2016 19:49:38 +0100 Subject: Fix std::vector of pointers which failed if a pointer to a pointer of the container element type existed (Python) Closes SF Bug 2359417 created after commit 93f039032204821d4fc363346587c90f640a1109 (svn rev 10958) --- Lib/std/std_common.i | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Lib/std/std_common.i') diff --git a/Lib/std/std_common.i b/Lib/std/std_common.i index b79eaff3a..05bc4325a 100644 --- a/Lib/std/std_common.i +++ b/Lib/std/std_common.i @@ -99,8 +99,21 @@ namespace swig { return traits::noconst_type >::type_name(); } - template - struct traits_info { + template struct traits_info { + static swig_type_info *type_query(std::string name) { + name += " *"; + return SWIG_TypeQuery(name.c_str()); + } + static swig_type_info *type_info() { + static swig_type_info *info = type_query(type_name()); + return info; + } + }; + + /* + Partial specialization for pointers (traits_info) + */ + template struct traits_info { static swig_type_info *type_query(std::string name) { name += " *"; return SWIG_TypeQuery(name.c_str()); @@ -117,7 +130,7 @@ namespace swig { } /* - Partial specialization for pointers + Partial specialization for pointers (traits) */ template struct traits { typedef pointer_category category; -- cgit v1.2.1