more cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5825 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
49a09a63fb
commit
b38eae9915
4 changed files with 93 additions and 0 deletions
70
Examples/test-suite/python/lib_std_map.i
Normal file
70
Examples/test-suite/python/lib_std_map.i
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
%module lib_std_map
|
||||
|
||||
//#define SWIG_STD_EXTEND_COMPARISON
|
||||
///
|
||||
%include std_pair.i
|
||||
%include std_map.i
|
||||
|
||||
%inline %{
|
||||
struct A{
|
||||
int val;
|
||||
|
||||
A(int v = 0): val(v)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
%}
|
||||
|
||||
namespace std
|
||||
{
|
||||
%template(pairii) pair<int, int>;
|
||||
%template(pairA) pair<int, A*>;
|
||||
%template(mapA) map<int, A*>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
%inline
|
||||
{
|
||||
std::pair<int, A*>
|
||||
p_identa(std::pair<int, A*> p) {
|
||||
return p;
|
||||
}
|
||||
|
||||
std::map<int,A*> m_identa(const std::map<int,A*>& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
%inline %{
|
||||
struct C{};
|
||||
typedef C* pC;
|
||||
|
||||
template <class A, class B>
|
||||
struct Test
|
||||
{
|
||||
Test (A a, B b)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
template <class A, class B>
|
||||
struct Test<A, B*>
|
||||
{
|
||||
Test (A a, B* b)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
%}
|
||||
|
||||
|
||||
%template(test_pC) Test<int, pC>;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue