This is similar to be491506a (Java std::vector improvements for types
that do not have a default constructor., 2019-03-01) for Java, except we
don't have to bother with any compatibility constraints for this, not
yet used by anyone. module.
19 lines
420 B
OpenEdge ABL
19 lines
420 B
OpenEdge ABL
%module stl_no_default_constructor
|
|
|
|
%include <stl.i>
|
|
|
|
%inline %{
|
|
struct NoDefaultCtor {
|
|
int value;
|
|
NoDefaultCtor(int i) : value(i) {}
|
|
};
|
|
%}
|
|
|
|
#if defined(SWIGC) || defined(SWIGCSHARP) || defined(SWIGJAVA) || defined(SWIGD)
|
|
%template(VectorNoDefaultCtor) std::vector<NoDefaultCtor>;
|
|
#endif
|
|
|
|
#if defined(SWIGJAVA) || defined(SWIGJAVA)
|
|
%include <std_list.i>
|
|
%template(ListNoDefaultCtor) std::list<NoDefaultCtor>;
|
|
#endif
|