C++11 strongly typed enum fixes for directors
Tests added for previous commit. Further refinements to patch #308 and fixes #307.
This commit is contained in:
parent
6a7250d71b
commit
fd8dcf44bf
6 changed files with 21 additions and 6 deletions
|
|
@ -516,6 +516,7 @@ CPP11_TEST_CASES = \
|
|||
cpp11_decltype \
|
||||
cpp11_default_delete \
|
||||
cpp11_delegating_constructors \
|
||||
cpp11_director_enums \
|
||||
cpp11_explicit_conversion_operators \
|
||||
cpp11_final_override \
|
||||
cpp11_function_objects \
|
||||
|
|
|
|||
14
Examples/test-suite/cpp11_director_enums.i
Normal file
14
Examples/test-suite/cpp11_director_enums.i
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
%module(directors="1") cpp11_director_enums
|
||||
|
||||
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) Cpp11DirectorEnumsCallback::g;
|
||||
|
||||
%director Cpp11DirectorEnumsCallback;
|
||||
|
||||
%inline %{
|
||||
enum class Color { Red, Green, Blue=10 };
|
||||
struct Cpp11DirectorEnumsCallback {
|
||||
virtual Color f(Color c) = 0;
|
||||
virtual const Color & g(const Color &c) = 0;
|
||||
virtual ~Cpp11DirectorEnumsCallback() {}
|
||||
};
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue