Add one more alternate function test
Checking member function pointer parameters
This commit is contained in:
parent
0ccef1424a
commit
8e86aaf2c3
1 changed files with 8 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ struct SomeStruct {
|
|||
auto addAlternateConst(int x, int y) const -> int;
|
||||
auto addAlternateNoExcept(int x, int y) noexcept -> int;
|
||||
auto addAlternateConstNoExcept(int x, int y) const noexcept -> int;
|
||||
auto addAlternateMemberPtrParm(int x, int (SomeStruct::*mp)(int, int)) -> int;
|
||||
auto addAlternateMemberPtrConstParm(int x, int (SomeStruct::*mp)(int, int) const) const -> int;
|
||||
};
|
||||
|
||||
int SomeStruct::addNormal(int x, int y) { return x + y; }
|
||||
|
|
@ -16,5 +18,11 @@ auto SomeStruct::addAlternate(int x, int y) -> int { return x + y; }
|
|||
auto SomeStruct::addAlternateConst(int x, int y) const -> int { return x + y; }
|
||||
auto SomeStruct::addAlternateNoExcept(int x, int y) noexcept -> int { return x + y; }
|
||||
auto SomeStruct::addAlternateConstNoExcept(int x, int y) const noexcept -> int { return x + y; }
|
||||
auto SomeStruct::addAlternateMemberPtrParm(int x, int (SomeStruct::*mp)(int, int)) -> int {
|
||||
return 100*x + (this->*mp)(x, x);
|
||||
}
|
||||
auto SomeStruct::addAlternateMemberPtrConstParm(int x, int (SomeStruct::*mp)(int, int) const) const -> int {
|
||||
return 1000*x + (this->*mp)(x, x);
|
||||
}
|
||||
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue