Added testcase for default/delete arguments introduced in C++0x.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@11535 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2f3a18e49b
commit
955c736164
2 changed files with 24 additions and 1 deletions
22
Examples/test-suite/cpp0x_default_delete.i
Normal file
22
Examples/test-suite/cpp0x_default_delete.i
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
%module cpp0x_default_delete
|
||||
|
||||
%{
|
||||
#include <stdlib.h>
|
||||
|
||||
class NonCopyable {
|
||||
public:
|
||||
NonCopyable & operator=(const NonCopyable&) = delete; /* Removes operator= */
|
||||
NonCopyable(const NonCopyable&) = delete; /* Removed copy constructor */
|
||||
NonCopyable() = default; /* Explicitly allows the empty constructor */
|
||||
void *operator new(size_t) = delete; /* Removes new NonCopyable */
|
||||
};
|
||||
|
||||
struct A1 {
|
||||
void f(int i);
|
||||
void f(double i) = delete; /* Don't cast double to int. Compiler returns an error */
|
||||
};
|
||||
struct A2 {
|
||||
void f(int i);
|
||||
template<class T> void f(T) = delete; /* Only accept int */
|
||||
};
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue