Improve director unwrap detection for the return type

Resolve the return type to correctly determine if the type is a pointer or
reference to a director class.

SwigType_refptr_count_return() recently added as a simpler fix is no
longer needed.

The conventional approach of using the "type" rather than "decl" to
analyse the return type is used instead too.

Issue #1823
This commit is contained in:
William S Fulton 2022-10-10 08:27:44 +01:00
commit 2f55379687
10 changed files with 76 additions and 90 deletions

View file

@ -25,6 +25,8 @@ class Element {
return &selfptr;
}
};
typedef Element * element_ptr_t;
typedef Element & element_ref_t;
class Storage {
public:
@ -45,6 +47,15 @@ class Storage {
Element *&getElementPtrRef() {
return *getIt();
}
element_ref_t getElementRefTypedef() {
return **getIt();
}
element_ptr_t getElementPtrTypedef() {
return *getIt();
}
element_ptr_t &getElementPtrRefTypedef() {
return *getIt();
}
};
template<class T> class StorageTmpl {