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
This commit is contained in:
Matevz Jekovec 2009-06-26 22:23:07 +00:00
commit 4946748164
4 changed files with 37 additions and 1 deletions

View file

@ -400,7 +400,8 @@ CPP_TEST_CASES += \
# C++0x test cases.
CPP0X_TEST_CASES = \
cpp0x_template_double_brackets
cpp0x_template_double_brackets \
cpp0x_explicit_conversion_operators
# cpp0x_constexpr # not supported by any compilers yet
# Broken C++0x test cases.

View file

@ -1,3 +1,6 @@
/* This interface tests whether Swig supports the new "constexpr" keyword
introduced by C++0x.
*/
%module foo
%inline %{

View file

@ -0,0 +1,28 @@
/* 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;
};
%}

View file

@ -1,3 +1,7 @@
/* This interface checks whether Swig supports the new double angled brackets
in the template syntax without having a space inbetween. This feature was
introduced in new C++0x standard.
*/
%module foo
%inline %{
#include <map>