more fixes for template + def args
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6833 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e4cdbbfaef
commit
b8ae49d52d
17 changed files with 203 additions and 284 deletions
|
|
@ -44,10 +44,12 @@
|
|||
%template(list_i) std::list<int>;
|
||||
%template(deque_i) std::deque<int>;
|
||||
|
||||
%template(vector_b) std::vector<bool>;
|
||||
%template(vector_i) std::vector<int>;
|
||||
%template(vector_c) std::vector<std::complex<double> >;
|
||||
%template(vector_ui) std::vector<unsigned int>;
|
||||
|
||||
%template(bmatrix) std::vector<std::vector<bool> >;
|
||||
%template(imatrix) std::vector<std::vector<int> >;
|
||||
%template(cmatrix) std::vector<std::vector<std::complex<double> > >;
|
||||
|
||||
|
|
@ -56,7 +58,13 @@
|
|||
%inline
|
||||
{
|
||||
typedef std::vector<std::vector<int> > imatrix;
|
||||
imatrix mident(const imatrix& v)
|
||||
imatrix midenti(const imatrix& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
typedef std::vector<std::vector<bool> > bmatrix;
|
||||
bmatrix midentb(const bmatrix& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,9 +33,13 @@ if v[0:3][1] != vu[0:3][1]:
|
|||
|
||||
|
||||
m = ((1,2,3),(2,3),(3,4))
|
||||
if m != std_containers.mident(m):
|
||||
if m != std_containers.midenti(m):
|
||||
raise RuntimeError, "bad getslice"
|
||||
|
||||
|
||||
mb = ((1,0,1),(1,1),(1,1))
|
||||
if mb != std_containers.midentb(mb):
|
||||
raise RuntimeError, "bad getslice"
|
||||
|
||||
|
||||
mi = std_containers.imatrix(m)
|
||||
mc = std_containers.cmatrix(m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue