Files
cpp-thirdparty/winx64/bin/swig-3.0.12/Examples/test-suite/cpp11_unrestricted_unions.i
Bassem Girgis 81b4b9e273 Initial commit
2018-12-20 17:34:07 -06:00

24 lines
522 B
OpenEdge ABL

/* This testcase checks whether SWIG correctly parses the support for types
without the defined trivial constructor in the unions. */
%module cpp11_unrestricted_unions
%inline %{
struct point {
point() {}
point(int x, int y) : x_(x), y_(y) {}
int x_, y_;
};
#include <new> // For placement 'new' in the constructor below
union P {
int z;
double w;
point p; // Illegal in C++03; legal in C++11.
// Due to the point member, a constructor definition is required.
P() {
new(&p) point();
}
} p1;
%}