- better support for classes with no default constructor, equal or
comparison methods.
you will be able to do
struct Foo {
Foo(int) {}
};
%std_nodefconst_type(Foo); // Says Foo has no def. constructor
%template(vector_Foo) std::vector<Foo>;
and the conflicting vector/list/deque methods will not be generated.
more cosmetic, and a note about the relation between std::map and
std::pair.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5810 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
efdc4c83dd
commit
29a30e2dcc
10 changed files with 79 additions and 77 deletions
|
|
@ -54,18 +54,15 @@
|
|||
namespace swigpy {
|
||||
template <class T>
|
||||
struct traits_asptr<std::deque<T> > {
|
||||
typedef std::deque<T> deque_type;
|
||||
typedef T value_type;
|
||||
static int asptr(PyObject *obj, deque_type **vec) {
|
||||
return traits_asptr_stdseq<deque_type>::asptr(obj, vec);
|
||||
static int asptr(PyObject *obj, std::deque<T> **vec) {
|
||||
return traits_asptr_stdseq<std::deque<T> >::asptr(obj, vec);
|
||||
}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct traits_from<std::deque<T> > {
|
||||
typedef std::deque<T> deque_type;
|
||||
static PyObject *from(const deque_type& vec) {
|
||||
return traits_from_stdseq<deque_type>::from(vec);
|
||||
static PyObject *from(const std::deque<T> & vec) {
|
||||
return traits_from_stdseq<std::deque<T> >::from(vec);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -102,7 +99,7 @@ namespace std {
|
|||
|
||||
%typemap_traits_ptr(SWIG_CCode(DEQUE), std::deque<T >);
|
||||
|
||||
%std_deque_methods(std::deque<T >);
|
||||
%std_deque_methods(deque);
|
||||
%pysequence_methods(std::deque<T >);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue