summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-12-27 18:18:53 -0700
committerLinus Groh <mail@linusgroh.de>2022-01-23 22:45:21 +0000
commit77b3230c806d3ee8d5ceb50b60a1ed88ba62d737 (patch)
tree832372b5465262ab9109fd16dc5719fb5f2492be /AK
parent92e337de21fb29936837130ddc6353b78c444504 (diff)
downloadserenity-77b3230c806d3ee8d5ceb50b60a1ed88ba62d737.zip
AK: Loosen FixedPoint template contraints and forward-declare it
Because AK/Concepts.h includes AK/Forward.h and concepts cannot be forward declared, slightly losen the FixedPoint template arguments so that we can forward declare it in AK/Forward.h
Diffstat (limited to 'AK')
-rw-r--r--AK/FixedPoint.h3
-rw-r--r--AK/Forward.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/AK/FixedPoint.h b/AK/FixedPoint.h
index f50e514b35..a67aa81f0c 100644
--- a/AK/FixedPoint.h
+++ b/AK/FixedPoint.h
@@ -14,7 +14,8 @@
namespace AK {
// FIXME: this always uses round to nearest break-tie to even
-template<size_t precision, Integral Underlying = i32>
+// FIXME: use the Integral concept to constrain Underlying
+template<size_t precision, typename Underlying>
class FixedPoint {
using This = FixedPoint<precision, Underlying>;
constexpr static Underlying radix_mask = (1 << precision) - 1;
diff --git a/AK/Forward.h b/AK/Forward.h
index 638ffaa6d8..1a682745bf 100644
--- a/AK/Forward.h
+++ b/AK/Forward.h
@@ -90,6 +90,9 @@ class Badge;
template<typename T>
class FixedArray;
+template<size_t precision, typename Underlying = i32>
+class FixedPoint;
+
template<typename>
class Function;
@@ -144,6 +147,7 @@ using AK::DuplexMemoryStream;
using AK::Error;
using AK::ErrorOr;
using AK::FixedArray;
+using AK::FixedPoint;
using AK::FlyString;
using AK::Function;
using AK::GenericLexer;