From 62e4d1e507e861e66a7cfbfa0804274df5d483c1 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 17 Nov 2023 16:41:30 +0000 Subject: [PATCH] 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. --- src/core/geometry_type.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/geometry_type.hpp b/src/core/geometry_type.hpp index 323cadc702..4f2d9d4fcf 100644 --- a/src/core/geometry_type.hpp +++ b/src/core/geometry_type.hpp @@ -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 {