Codechange: Dimension must have both width and height.

Default parameters allowed Dimension to be constructed with only a width.

Instead use separate empty and width/height constructors to ensure that either none or both are provided.
This commit is contained in:
Peter Nelson 2023-11-17 16:41:30 +00:00 committed by Peter Nelson
parent 0b1429ce14
commit 62e4d1e507
1 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,8 @@ struct Dimension {
uint width;
uint height;
Dimension(uint w = 0, uint h = 0) : width(w), height(h) {};
constexpr Dimension() : width(0), height(0) {}
constexpr Dimension(uint w, uint h) : width(w), height(h) {}
bool operator< (const Dimension &other) const
{