Преглед изворни кода

common/math_util: Make Rectangle's constructors constexpr

Allows objects that contain rectangle instances to be constexpr
constructible as well.
Lioncash пре 7 година
родитељ
комит
f11173f88c
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/common/math_util.h

+ 2 - 2
src/common/math_util.h

@@ -18,9 +18,9 @@ struct Rectangle {
     T right{};
     T bottom{};
 
-    Rectangle() = default;
+    constexpr Rectangle() = default;
 
-    Rectangle(T left, T top, T right, T bottom)
+    constexpr Rectangle(T left, T top, T right, T bottom)
         : left(left), top(top), right(right), bottom(bottom) {}
 
     T GetWidth() const {