parent
aee380ce82
commit
27a3d16ac6
3 changed files with 14 additions and 0 deletions
|
|
@ -3,6 +3,8 @@
|
|||
%module cpp11_alternate_function_syntax
|
||||
|
||||
%inline %{
|
||||
struct Hello {};
|
||||
|
||||
struct SomeStruct {
|
||||
int addNormal(int x, int y);
|
||||
auto addAlternate(int x, int y) -> int;
|
||||
|
|
@ -12,6 +14,9 @@ struct SomeStruct {
|
|||
auto addAlternateMemberPtrParm(int x, int (SomeStruct::*mp)(int, int)) -> int;
|
||||
auto addAlternateMemberPtrConstParm(int x, int (SomeStruct::*mp)(int, int) const) const -> int;
|
||||
|
||||
// Returning a reference didn't parse in SWIG < 4.1.0 (#231)
|
||||
auto output() -> Hello&;
|
||||
|
||||
virtual auto addFinal(int x, int y) const noexcept -> int final { return x + y; }
|
||||
virtual ~SomeStruct() = default;
|
||||
};
|
||||
|
|
@ -27,5 +32,6 @@ auto SomeStruct::addAlternateMemberPtrParm(int x, int (SomeStruct::*mp)(int, int
|
|||
auto SomeStruct::addAlternateMemberPtrConstParm(int x, int (SomeStruct::*mp)(int, int) const) const -> int {
|
||||
return 1000*x + (this->*mp)(x, x);
|
||||
}
|
||||
auto SomeStruct::output() -> Hello& { static Hello h; return h; }
|
||||
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue