more valuewrapper cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6380 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5c930fcb09
commit
b5c610922a
2 changed files with 17 additions and 3 deletions
|
|
@ -28,6 +28,15 @@ public:
|
|||
%feature("novaluewrapper") B;
|
||||
class B;
|
||||
|
||||
/*
|
||||
* Force swig to use the value wrapper, even when the class
|
||||
* has a default constructor, in case you want to save a
|
||||
* instance construction.
|
||||
*
|
||||
*/
|
||||
%feature("valuewrapper") D;
|
||||
class D;
|
||||
|
||||
|
||||
%inline %{
|
||||
|
||||
|
|
@ -37,6 +46,8 @@ public:
|
|||
A(int){}
|
||||
};
|
||||
|
||||
class D {};
|
||||
|
||||
class Klass {};
|
||||
|
||||
|
||||
|
|
@ -90,6 +101,10 @@ auto_ptr<A> getPtrA(auto_ptr<A> a) {
|
|||
B getB(B a) {
|
||||
return a;
|
||||
}
|
||||
|
||||
D getD(D a) {
|
||||
return a;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,9 +359,8 @@ SwigType *cplus_value_type(SwigType *t) {
|
|||
if (((Strcmp(nodeType(n),"class") == 0)
|
||||
&& !Getattr(n,"allocate:noassign")
|
||||
&& (Getattr(n,"allocate:default_constructor")))
|
||||
|| (Getattr(n,"feature:novaluewrapper")
|
||||
&& !Getattr(n,"feature:valuewrapper"))) {
|
||||
use_wrapper = 0;
|
||||
|| (Getattr(n,"feature:novaluewrapper"))) {
|
||||
use_wrapper = Getattr(n,"feature:valuewrapper") ? 1 : 0;
|
||||
}
|
||||
}
|
||||
Delete(ftd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue