Internals: Use C++14 exchange

This commit is contained in:
Wilson Snyder
2024-01-28 21:00:20 -05:00
parent e3e5f30ba1
commit eecdf4b0f3
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -109,12 +109,12 @@ class DfgGraph final {
// cppcheck-suppress noExplicitConstructor
UserDataInUse(UserDataInUse&& that) {
UASSERT(that.m_graphp, "Moving from empty");
m_graphp = vlstd::exchange(that.m_graphp, nullptr);
m_graphp = std::exchange(that.m_graphp, nullptr);
}
VL_UNCOPYABLE(UserDataInUse);
UserDataInUse& operator=(UserDataInUse&& that) {
UASSERT(that.m_graphp, "Moving from empty");
m_graphp = vlstd::exchange(that.m_graphp, nullptr);
m_graphp = std::exchange(that.m_graphp, nullptr);
return *this;
}