Explorar o código

LibGfx: Mark `AffineTransform<T>::map()` as only working for numeric `T`

The implementations for these methods is manually defined in the .cpp
file for `int` and `float`, meaning that other `T` values would fail -
but only once we got to the linking stage. This patch makes the error
happen much earlier, so it's more obvious.
Sam Atkins %!s(int64=2) %!d(string=hai) anos
pai
achega
e5a25171fe
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      Userland/Libraries/LibGfx/AffineTransform.h

+ 4 - 3
Userland/Libraries/LibGfx/AffineTransform.h

@@ -6,6 +6,7 @@
 
 #pragma once
 
+#include <AK/Concepts.h>
 #include <AK/Format.h>
 #include <AK/Forward.h>
 #include <LibGfx/Forward.h>
@@ -29,13 +30,13 @@ public:
 
     void map(float unmapped_x, float unmapped_y, float& mapped_x, float& mapped_y) const;
 
-    template<typename T>
+    template<Arithmetic T>
     Point<T> map(Point<T> const&) const;
 
-    template<typename T>
+    template<Arithmetic T>
     Size<T> map(Size<T> const&) const;
 
-    template<typename T>
+    template<Arithmetic T>
     Rect<T> map(Rect<T> const&) const;
 
     Quad<float> map_to_quad(Rect<float> const&) const;