more cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5816 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0c8f4b34bf
commit
9bf8d63e04
3 changed files with 58 additions and 1 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
%}
|
%}
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
|
%template(CIntPair) pair<const int, const int>;
|
||||||
%template() pair<double, double>;
|
%template() pair<double, double>;
|
||||||
%template(String) basic_string<char>;
|
%template(String) basic_string<char>;
|
||||||
%template(IntPair) pair<int, int>;
|
%template(IntPair) pair<int, int>;
|
||||||
|
|
@ -29,6 +30,8 @@ namespace std {
|
||||||
%template(SIIPair) pair<std::pair<std::string, int>, int>;
|
%template(SIIPair) pair<std::pair<std::string, int>, int>;
|
||||||
%template(AIntPair) pair<A, int>;
|
%template(AIntPair) pair<A, int>;
|
||||||
|
|
||||||
|
%template(CCIntPair) pair<const A, const pair<int, int> >;
|
||||||
|
|
||||||
%template(ABPair) pair<A, B>;
|
%template(ABPair) pair<A, B>;
|
||||||
%template(IntAPair) pair<int, A>;
|
%template(IntAPair) pair<int, A>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
40
Examples/test-suite/python/lib_std_pair_runme.py
Normal file
40
Examples/test-suite/python/lib_std_pair_runme.py
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import lib_std_pair
|
||||||
|
|
||||||
|
p = (1,2)
|
||||||
|
p1 = lib_std_pair.p_inout(p)
|
||||||
|
p2 = lib_std_pair.p_inoutd(p1)
|
||||||
|
|
||||||
|
d1 = lib_std_pair.d_inout(2)
|
||||||
|
|
||||||
|
i,d2 = lib_std_pair.d_inout2(2)
|
||||||
|
|
||||||
|
i,p = lib_std_pair.p_inout2(p)
|
||||||
|
p3,p4 = lib_std_pair.p_inout3(p1,p1)
|
||||||
|
|
||||||
|
psi = lib_std_pair.SIPair("hello",1)
|
||||||
|
pci = lib_std_pair.CIPair(1,1)
|
||||||
|
|
||||||
|
|
||||||
|
psi.first = "hi"
|
||||||
|
|
||||||
|
|
||||||
|
psi = lib_std_pair.SIPair("hi",1)
|
||||||
|
if psi != ("hi",1):
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
psii = lib_std_pair.SIIPair(psi,1)
|
||||||
|
|
||||||
|
a = lib_std_pair.A()
|
||||||
|
b = lib_std_pair.B()
|
||||||
|
|
||||||
|
pab = lib_std_pair.ABPair(a,b);
|
||||||
|
|
||||||
|
pab.first = a
|
||||||
|
pab.first.val = 2
|
||||||
|
|
||||||
|
if pab.first.val != 2:
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
||||||
|
pci = lib_std_pair.CIntPair(1,0)
|
||||||
|
|
||||||
|
|
@ -162,5 +162,19 @@ template <class C> struct Param
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct Foo
|
||||||
|
{
|
||||||
|
Foo(int i) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%std_nodefconst_type(Foo);
|
||||||
|
|
||||||
|
%template(vector_Foo) std::vector<Foo>;
|
||||||
|
%template(deque_Foo) std::deque<Foo>;
|
||||||
|
%template(list_Foo) std::list<Foo>;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue