diff options
Diffstat (limited to 'Lib/std/std_common.i')
-rw-r--r-- | Lib/std/std_common.i | 19 |
1 files changed, 16 insertions, 3 deletions
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<typename noconst_traits<Type >::noconst_type >::type_name(); } - template <class Type> - struct traits_info { + template <class Type> 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<Type>()); + return info; + } + }; + + /* + Partial specialization for pointers (traits_info) + */ + template <class Type> struct traits_info<Type *> { 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 <class Type> struct traits <Type *> { typedef pointer_category category; |