summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-16 00:41:28 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-17 00:21:12 +0100
commit11aad74dce5e0cf5eea6aa3d68644b26100869d1 (patch)
tree34074684735e405b6e7345ca48c40e377674ba5b /AK
parent587f9af960daa9f003ec9e41751cdc4ce50b87dd (diff)
downloadserenity-11aad74dce5e0cf5eea6aa3d68644b26100869d1.zip
AK: Forward declare Error and ErrorOr in AK/Forward.h
Diffstat (limited to 'AK')
-rw-r--r--AK/Error.h2
-rw-r--r--AK/Forward.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/AK/Error.h b/AK/Error.h
index b85a0ac012..fcc08d3008 100644
--- a/AK/Error.h
+++ b/AK/Error.h
@@ -45,7 +45,7 @@ private:
StringView m_string_literal;
};
-template<typename T, typename ErrorType = Error>
+template<typename T, typename ErrorType>
class [[nodiscard]] ErrorOr {
public:
ErrorOr(T const& value)
diff --git a/AK/Forward.h b/AK/Forward.h
index 3534cb529e..638ffaa6d8 100644
--- a/AK/Forward.h
+++ b/AK/Forward.h
@@ -17,6 +17,7 @@ class ByteBuffer;
class Bitmap;
using ByteBuffer = AK::Detail::ByteBuffer<32>;
+class Error;
class GenericLexer;
class IPv4Address;
class JsonArray;
@@ -125,6 +126,9 @@ class WeakPtr;
template<typename T, size_t inline_capacity = 0>
requires(!IsRvalueReference<T>) class Vector;
+template<typename T, typename ErrorType = Error>
+class [[nodiscard]] ErrorOr;
+
}
using AK::Array;
@@ -137,6 +141,8 @@ using AK::CircularDuplexStream;
using AK::CircularQueue;
using AK::DoublyLinkedList;
using AK::DuplexMemoryStream;
+using AK::Error;
+using AK::ErrorOr;
using AK::FixedArray;
using AK::FlyString;
using AK::Function;