| 63 | int value; |
| 64 | }; |
| 65 | class MoveOrCopyInt { |
| 66 | public: |
| 67 | MoveOrCopyInt() { print_default_created(this); } |
| 68 | explicit MoveOrCopyInt(int v) : value{v} { print_created(this, value); } |
| 69 | MoveOrCopyInt(MoveOrCopyInt &&m) noexcept { |
| 70 | print_move_created(this, m.value); |
| 71 | std::swap(value, m.value); |
| 72 | } |
| 73 | MoveOrCopyInt &operator=(MoveOrCopyInt &&m) noexcept { |
| 74 | print_move_assigned(this, m.value); |
| 75 | std::swap(value, m.value); |
| 76 | return *this; |
| 77 | } |
| 78 | MoveOrCopyInt(const MoveOrCopyInt &c) { |
| 79 | print_copy_created(this, c.value); |
| 80 | // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer) |
| 81 | value = c.value; |
| 82 | } |
| 83 | MoveOrCopyInt &operator=(const MoveOrCopyInt &c) { |
| 84 | print_copy_assigned(this, c.value); |
| 85 | value = c.value; |
| 86 | return *this; |
| 87 | } |
| 88 | ~MoveOrCopyInt() { print_destroyed(this); } |
| 89 | |
| 90 | int value; |
| 91 | }; |
| 92 | class CopyOnlyInt { |
| 93 | public: |
| 94 | CopyOnlyInt() { print_default_created(this); } |