summaryrefslogtreecommitdiff
path: root/Lib/std/std_common.i
diff options
context:
space:
mode:
authorNishant Gupta <nish.gupta01@gmail.com>2016-08-03 10:05:34 +0530
committerNishant Gupta <nish.gupta01@gmail.com>2016-08-03 10:05:34 +0530
commitb69cfd95e0e9524456993469cfaf57146079f5d2 (patch)
tree41a9027ada4769fe60d8110408ea26c1ec52d503 /Lib/std/std_common.i
parent27c278180f89f90545e67792802707babda7795e (diff)
parent2740812970382202fe97e52f7c881eaa71c2e7c0 (diff)
downloadswig-b69cfd95e0e9524456993469cfaf57146079f5d2.tar.gz
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'Lib/std/std_common.i')
-rw-r--r--Lib/std/std_common.i19
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;