diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-11-15 10:01:23 -0500 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2022-11-15 13:25:51 -0500 |
commit | b1ea418d14b4392741720914b834c61322cdb5b4 (patch) | |
tree | ca0dfec6a89dfe3dfe438533ac51e2c02138415d /Userland/Libraries/LibIPC/Encoder.h | |
parent | 421ebc2e297e504f07afce76708eb37eb3da9c82 (diff) | |
download | serenity-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/Encoder.h')
-rw-r--r-- | Userland/Libraries/LibIPC/Encoder.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibIPC/Encoder.h b/Userland/Libraries/LibIPC/Encoder.h index 5da7b9ac7c..058b33831e 100644 --- a/Userland/Libraries/LibIPC/Encoder.h +++ b/Userland/Libraries/LibIPC/Encoder.h @@ -16,7 +16,7 @@ namespace IPC { template<typename T> -bool encode(Encoder&, T&) +bool encode(Encoder&, T const&) { static_assert(DependentFalse<T>, "Base IPC::encode() was instantiated"); VERIFY_NOT_REACHED(); |