mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibIPC: Remove requirement that Variant types must begin with Empty
This is no longer required by the decoder.
This commit is contained in:
parent
9b483625e6
commit
4abafbbe3c
1 changed files with 1 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue