Skip to content

Commit fbd13ad

Browse files
committed
Step 2
1 parent 9d45764 commit fbd13ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stl/inc/any

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,10 @@ public:
230230
}
231231

232232
void swap(any& _That) noexcept {
233-
std::any _Old_val = _STD move(*this);
234-
*this = _STD move(_That);
235-
_That = _STD move(_Old_val);
233+
any _Old = _STD move(*this);
234+
*this = _STD move(_That);
235+
_That.reset();
236+
_That._Move_from(_Old);
236237
}
237238

238239
// Observers [any.observers]

0 commit comments

Comments
 (0)