Update swap functions to recommended ADL-friendly format

This commit is contained in:
2023-01-24 20:33:38 -05:00
parent 64c7e4a5a0
commit d5ea213edd
12 changed files with 186 additions and 179 deletions

View File

@@ -248,10 +248,11 @@ public:
data.resize(new_sz, def);
}
}
void swap(vector2d& other) {
data.swap(other.data);
std::swap(w, other.w);
std::swap(h, other.h);
friend void swap(vector2d& lhs, vector2d& rhs) {
using std::swap;
swap(lhs.data, rhs.data);
swap(lhs.w, rhs.w);
swap(lhs.h, rhs.h);
}
bool empty() const {
return data.empty();