mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Simplify some C++ abstractions (#1518)
* Remove namespaces * Prefer `bool operator==`, not `friend auto operator==` * Prefer not to use `using` * Use a `constexpr` function instead of a template for `flipTable`
This commit is contained in:
@@ -15,10 +15,6 @@
|
||||
#include "gfx/main.hpp"
|
||||
#include "gfx/proto_palette.hpp"
|
||||
|
||||
using std::swap;
|
||||
|
||||
namespace packing {
|
||||
|
||||
// The solvers here are picked from the paper at https://arxiv.org/abs/1605.00558:
|
||||
// "Algorithms for the Pagination Problem, a Bin Packing with Overlapping Items"
|
||||
// Their formulation of the problem consists in packing "tiles" into "pages"; here is a
|
||||
@@ -114,8 +110,8 @@ private:
|
||||
}
|
||||
|
||||
friend void swap(Iter &lhs, Iter &rhs) {
|
||||
swap(lhs._array, rhs._array);
|
||||
swap(lhs._iter, rhs._iter);
|
||||
std::swap(lhs._array, rhs._array);
|
||||
std::swap(lhs._iter, rhs._iter);
|
||||
}
|
||||
};
|
||||
public:
|
||||
@@ -537,5 +533,3 @@ std::tuple<DefaultInitVec<size_t>, size_t>
|
||||
}
|
||||
return {mappings, assignments.size()};
|
||||
}
|
||||
|
||||
} // namespace packing
|
||||
|
||||
Reference in New Issue
Block a user