swig/Lib/c/std_vector.i
Vadim Zeitlin fe8c6fad44 Ignore std::vector<T>::get_allocator()
This is not really useful in C wrappers and results in ugly descriptor for the
allocator type appearing in the output, better to avoid it.
2016-09-15 01:27:41 +02:00

16 lines
545 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); }
}
// Standard typemaps wrap get_allocator(), but it's not really useful for us, so don't bother with it.
%ignore get_allocator
%enddef
%define %swig_vector_methods_val(Type...)
%swig_vector_methods(Type...)
%enddef
%include <std/std_vector.i>