Test copy constructor and assignment operator calls for movable types
This is the current state of play where the copy constructor and copy assignment operators are called, even for movable types passed as function parameters.
This commit is contained in:
parent
e1173cac26
commit
1ece69cafd
4 changed files with 37 additions and 0 deletions
|
|
@ -27,6 +27,8 @@ struct MoveOnly {
|
|||
|
||||
static MoveOnly create() { return MoveOnly(111); }
|
||||
// static const MoveOnly createConst() { return MoveOnly(111); } // not supported by default
|
||||
|
||||
// static void take(MoveOnly mo) { if (debug) cout << "take(MoveOnly)" << " " << &mo << endl; }
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
@ -48,5 +50,7 @@ struct MovableCopyable {
|
|||
|
||||
static MovableCopyable create() { return MovableCopyable(111); }
|
||||
static const MovableCopyable createConst() { return MovableCopyable(111); }
|
||||
|
||||
static void take(MovableCopyable mc) { if (debug) cout << "take(MovableCopyable)" << " " << &mc << endl; }
|
||||
};
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue