Scilab: add generic support for STL list
This commit is contained in:
parent
ca282beae6
commit
f09525bcd8
2 changed files with 28 additions and 0 deletions
27
Lib/scilab/std_list.i
Normal file
27
Lib/scilab/std_list.i
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
Lists
|
||||
*/
|
||||
|
||||
%fragment("StdListTraits", "header", fragment="StdSequenceTraits")
|
||||
%{
|
||||
namespace swig {
|
||||
template <class T >
|
||||
struct traits_asptr<std::list<T> > {
|
||||
static int asptr(SciObject obj, std::list<T> **lis) {
|
||||
return traits_asptr_stdseq<std::list<T> >::asptr(obj, lis);
|
||||
}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct traits_from<std::list<T> > {
|
||||
static SciObject from(const std::list<T> &lis) {
|
||||
return traits_from_stdseq<std::list<T> >::from(lis);
|
||||
}
|
||||
};
|
||||
}
|
||||
%}
|
||||
|
||||
#define %swig_list_methods(Type...) %swig_sequence_methods(Type)
|
||||
#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type);
|
||||
|
||||
%include <std/std_list.i>
|
||||
|
|
@ -3,3 +3,4 @@
|
|||
%include std_string.i
|
||||
%include std_vector.i
|
||||
%include std_set.i
|
||||
%include std_list.i
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue