Merge remote-tracking branch 'origin/shared_ptr_const_conv' into shared_ptr_derived_2

This commit is contained in:
Takashi Tamura 2017-03-29 18:16:01 +09:00
commit 377d439964
4 changed files with 77 additions and 2 deletions

View file

@ -83,6 +83,14 @@ namespace swig {
}
}
};
}
template<class Type>
struct traits_from<std::shared_ptr<const Type> > {
static VALUE from(const std::shared_ptr<const Type>& val) {
std::shared_ptr<Type> p = std::const_pointer_cast<Type>(val);
return swig::from(p);
}
};
}
#endif
%}