swig/Examples/test-suite/cpp0x_uniform_initialization.i
2010-06-26 22:48:49 +00:00

22 lines
447 B
OpenEdge ABL

/* This testcase checks whether SWIG syntactically correctly parses the curly
brackets {} for uniform member initialization. */
%module cpp0x_uniform_initialization
%inline %{
struct BasicStruct {
int x;
double y;
};
struct AltStruct {
AltStruct(int x, double y) : x_{x}, y_{y} {}
private:
int x_;
double y_;
};
BasicStruct var1{5, 3.2}; // only fills the struct components
AltStruct var2{2, 4.3}; // calls the constructor
%}