new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4762 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b49895faf2
commit
bee8434140
2 changed files with 31 additions and 0 deletions
|
|
@ -237,6 +237,7 @@ CPP_TEST_CASES += \
|
||||||
using_protected \
|
using_protected \
|
||||||
valuewrapper \
|
valuewrapper \
|
||||||
valuewrapper_base \
|
valuewrapper_base \
|
||||||
|
valuewrapper_const \
|
||||||
varargs \
|
varargs \
|
||||||
virtual_destructor \
|
virtual_destructor \
|
||||||
voidtest
|
voidtest
|
||||||
|
|
|
||||||
30
Examples/test-suite/valuewrapper_const.i
Normal file
30
Examples/test-suite/valuewrapper_const.i
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
%module valuewrapper_const
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
// B requires swig to use the SwigValueWrapper
|
||||||
|
class B
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
B() { }
|
||||||
|
public:
|
||||||
|
B(const B&){ }
|
||||||
|
};
|
||||||
|
|
||||||
|
// A returns a B and a const B
|
||||||
|
class A
|
||||||
|
{
|
||||||
|
B b;
|
||||||
|
public:
|
||||||
|
A(const B& b) : b(b) { }
|
||||||
|
// this one works SwigValueWrapper< B > result;
|
||||||
|
B GetB() {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
// this one is incorrect B result;
|
||||||
|
const B GetB() const {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue