At the very least, this gives us a working vector<bool> and allows "li_std_vector" unit test to pass. It is also just nice to reuse the existing typemaps instead of having another copy of them. As C doesn't have UTL, some parts of std_vector.i had to be excluded from it however.
13 lines
415 B
OpenEdge ABL
13 lines
415 B
OpenEdge ABL
// Wrap const and non-const at() methods as set() and get(), this is simpler to use from C and more clear.
|
|
%define %swig_vector_methods(Type...)
|
|
%extend {
|
|
void set(size_type n, const value_type& val) { self->at(n) = val; }
|
|
value_type get(size_type n) const { return self->at(n); }
|
|
}
|
|
%enddef
|
|
|
|
%define %swig_vector_methods_val(Type...)
|
|
%swig_vector_methods(Type...)
|
|
%enddef
|
|
|
|
%include <std/std_vector.i>
|