Custom type caster move/copy test classes */
| 44 | |
| 45 | /* Custom type caster move/copy test classes */ |
| 46 | class MoveOnlyInt { |
| 47 | public: |
| 48 | MoveOnlyInt() { print_default_created(this); } |
| 49 | explicit MoveOnlyInt(int v) : value{v} { print_created(this, value); } |
| 50 | MoveOnlyInt(MoveOnlyInt &&m) noexcept { |
| 51 | print_move_created(this, m.value); |
| 52 | std::swap(value, m.value); |
| 53 | } |
| 54 | MoveOnlyInt &operator=(MoveOnlyInt &&m) noexcept { |
| 55 | print_move_assigned(this, m.value); |
| 56 | std::swap(value, m.value); |
| 57 | return *this; |
| 58 | } |
| 59 | MoveOnlyInt(const MoveOnlyInt &) = delete; |
| 60 | MoveOnlyInt &operator=(const MoveOnlyInt &) = delete; |
| 61 | ~MoveOnlyInt() { print_destroyed(this); } |
| 62 | |
| 63 | int value; |
| 64 | }; |
| 65 | class MoveOrCopyInt { |
| 66 | public: |
| 67 | MoveOrCopyInt() { print_default_created(this); } |