more tests

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5784 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-03-21 23:38:59 +00:00
commit 5a656bf645
13 changed files with 161 additions and 18 deletions

View file

@ -5,10 +5,17 @@
%include std_deque.i
%include std_list.i
%include std_set.i
%include std_multiset.i
%include std_pair.i
%include std_map.i
%include std_multimap.i
%include std_complex.i
#ifndef SWIG_STD_DEFAULT_INSTANTIATION
%template() std::vector<double>;
%template() std::pair<std::string, int>;
%template() std::pair<int,double>;
#endif
%template() std::vector< std::vector<double > > ;
%template(ccube) std::vector< std::vector< std::vector<double > > >;
@ -28,6 +35,7 @@
%template(map_si) std::map<std::string, int>;
%template(mmap_si) std::multimap<std::string, int>;
%template(set_i) std::set<int>;
%template(multiset_i) std::multiset<int>;
%template(list_i) std::list<int>;
@ -40,6 +48,8 @@
%template(imatrix) std::vector<std::vector<int> >;
%template(cmatrix) std::vector<std::vector<std::complex<double> > >;
%apply std::vector<int> *INOUT {std::vector<int> *INOUT2};
%inline
{
typedef std::vector<std::vector<int> > imatrix;
@ -58,6 +68,11 @@
return v;
}
std::multimap<std::string,int> mapident(const std::multimap<std::string,int>& v)
{
return v;
}
std::vector<int> vident(const std::vector<int>& v)
{
return v;
@ -83,8 +98,17 @@
{
return p;
}
void
v_inout(std::vector<int> *INOUT) {
*INOUT = *INOUT;
}
void
v_inout2(std::vector<int> *INOUT, std::vector<int> *INOUT2) {
std::swap(*INOUT, *INOUT2);
}
}
@ -114,11 +138,16 @@ template <class C> struct Param
{
struct A
{
A(int aa = 0) : a(aa)
{
}
int a;
};
}
%template() std::pair<A,int>;
%template(pair_iA) std::pair<int,A>;
%template(vector_piA) std::vector<std::pair<int,A> >;
%inline {
@ -126,5 +155,12 @@ template <class C> struct Param
{
return std::pair<A,int>();
}
std::vector<std::pair<int,A> > pia_vident(std::vector<std::pair<int,A> > a )
{
return a;
}
}