resource: swap

This commit is contained in:
Michele Caini
2024-09-09 12:02:33 +02:00
parent 7ad5eb8c17
commit eabe7be7da
3 changed files with 34 additions and 1 deletions
+9
View File
@@ -116,6 +116,15 @@ public:
return *this;
}
/**
* @brief Exchanges the content with that of a given resource.
* @param other Resource to exchange the content with.
*/
void swap(resource &other) {
using std::swap;
swap(value, other.value);
}
/**
* @brief Returns a reference to the managed resource.
*