Define "equivalent" typecheck typemap attribute for shared_ptr<>
This is required to handle overloaded functions taking shared_ptr or raw type correctly and is checked in cpp11_shared_ptr_overload unit test.
This commit is contained in:
parent
74e8a6e729
commit
bec35fa0c2
1 changed files with 12 additions and 0 deletions
|
|
@ -67,6 +67,18 @@
|
|||
explicit operator bool() const { return swig_self_ != nullptr; }
|
||||
%}
|
||||
|
||||
// This is required to handle overloads on shared_ptr/normal type correctly.
|
||||
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *")
|
||||
TYPE CONST,
|
||||
TYPE CONST &,
|
||||
TYPE CONST *,
|
||||
TYPE *CONST&,
|
||||
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >,
|
||||
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &,
|
||||
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *,
|
||||
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *&
|
||||
""
|
||||
|
||||
%enddef
|
||||
|
||||
%include <shared_ptr.i>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue