Commit f8d7bc1c authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

util/AllocatedArray: use std::exchange()

parent a684b4ff
/*
* Copyright 2010-2018 Max Kellermann <max.kellermann@gmail.com>
* Copyright 2010-2019 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -71,9 +71,7 @@ public:
}
AllocatedArray(AllocatedArray &&other) noexcept
:buffer(other.buffer) {
other.buffer = nullptr;
}
:buffer(std::exchange(other.buffer, nullptr)) {}
~AllocatedArray() noexcept {
delete[] buffer.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment