summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIPC/Encoder.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-12-22 21:29:36 -0500
committerAndreas Kling <kling@serenityos.org>2022-12-26 09:36:16 +0100
commit4abafbbe3c5bb647e3edd48a201deef0a211d07b (patch)
tree15ff153e5e52f117dacd4c11c6c03e7b3c32a658 /Userland/Libraries/LibIPC/Encoder.h
parent9b483625e653d2ea89533c99b501a2e296c4d366 (diff)
downloadserenity-4abafbbe3c5bb647e3edd48a201deef0a211d07b.zip
LibIPC: Remove requirement that Variant types must begin with Empty
This is no longer required by the decoder.
Diffstat (limited to 'Userland/Libraries/LibIPC/Encoder.h')
-rw-r--r--Userland/Libraries/LibIPC/Encoder.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibIPC/Encoder.h b/Userland/Libraries/LibIPC/Encoder.h
index 1d1696a4a0..e8bc3b0606 100644
--- a/Userland/Libraries/LibIPC/Encoder.h
+++ b/Userland/Libraries/LibIPC/Encoder.h
@@ -89,12 +89,9 @@ public:
return *this;
}
- // Note: We require any encodeable variant to have Empty as its first variant, as only possibly-empty variants can be default constructed.
- // The default constructability is required by generated IPC message marshalling code.
template<typename... VariantTypes>
- Encoder& operator<<(AK::Variant<AK::Empty, VariantTypes...> const& variant)
+ Encoder& operator<<(AK::Variant<VariantTypes...> const& variant)
{
- // Note: This might be either u8 or size_t depending on the size of the variant; both are encodeable.
*this << variant.index();
variant.visit([this](auto const& underlying_value) { *this << underlying_value; });
return *this;