From b1ea418d14b4392741720914b834c61322cdb5b4 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 15 Nov 2022 10:01:23 -0500 Subject: 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. --- Userland/Libraries/LibIPC/Forward.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Userland/Libraries/LibIPC/Forward.h') 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 +bool encode(Encoder&, T const&); + +template +ErrorOr decode(Decoder&, T&); + } -- cgit v1.2.3