summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIPC/Forward.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-15 10:01:23 -0500
committerTim Flynn <trflynn89@pm.me>2022-11-15 13:25:51 -0500
commitb1ea418d14b4392741720914b834c61322cdb5b4 (patch)
treeca0dfec6a89dfe3dfe438533ac51e2c02138415d /Userland/Libraries/LibIPC/Forward.h
parent421ebc2e297e504f07afce76708eb37eb3da9c82 (diff)
downloadserenity-b1ea418d14b4392741720914b834c61322cdb5b4.zip
LibIPC: Forward declare the encode() and decode() template functions
For the most part, we try to provide specializations of these functions in various headers by including "LibIPC/Forward.h" and then declaring encode() and decode() specializations. However, without any forward declaration of these types, we aren't actually specializing anything. Rather, we are just declaring overloads, which trips up the base encode and decode template definitions. The result is that LibIPC is very sensitive to include order, and the DependentFalse<> static assertion would fail if the includes weren't perfectly ordered. By properly forward declaring these templates, we can make sure the specializations receive precedence over the base templates.
Diffstat (limited to 'Userland/Libraries/LibIPC/Forward.h')
-rw-r--r--Userland/Libraries/LibIPC/Forward.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibIPC/Forward.h b/Userland/Libraries/LibIPC/Forward.h
index ccdb977edb..c59cca64d3 100644
--- a/Userland/Libraries/LibIPC/Forward.h
+++ b/Userland/Libraries/LibIPC/Forward.h
@@ -15,4 +15,10 @@ class Message;
class File;
class Stub;
+template<typename T>
+bool encode(Encoder&, T const&);
+
+template<typename T>
+ErrorOr<void> decode(Decoder&, T&);
+
}