swig/Examples/test-suite/cpp0x_explicit_conversion_operators.i
Matevz Jekovec 4946748164 Added test case for explicit conversion operators.
Some cosmetic fixes.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@11323 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-06-26 22:23:07 +00:00

28 lines
463 B
OpenEdge ABL

/* This interface checks whether Swig correctly compiles the new
explicit conversion operators feature introduced in C++0x.
*/
%module foo
%inline %{
class U {
public:
int u;
};
class V {
public:
int v;
};
class TestClass {
public:
//implicit converting constructor
TestClass( U const &val ) { t=val.u; }
// explicit constructor
explicit TestClass( V const &val ) { t=val.v; }
int t;
};
%}