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:
parent
d8012716ed
commit
4946748164
4 changed files with 37 additions and 1 deletions
|
|
@ -400,7 +400,8 @@ CPP_TEST_CASES += \
|
||||||
|
|
||||||
# C++0x test cases.
|
# C++0x test cases.
|
||||||
CPP0X_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
|
# cpp0x_constexpr # not supported by any compilers yet
|
||||||
|
|
||||||
# Broken C++0x test cases.
|
# Broken C++0x test cases.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
/* This interface tests whether Swig supports the new "constexpr" keyword
|
||||||
|
introduced by C++0x.
|
||||||
|
*/
|
||||||
%module foo
|
%module foo
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
|
||||||
28
Examples/test-suite/cpp0x_explicit_conversion_operators.i
Normal file
28
Examples/test-suite/cpp0x_explicit_conversion_operators.i
Normal 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;
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
@ -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
|
%module foo
|
||||||
%inline %{
|
%inline %{
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue