mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
LibIPC+IPCCompiler: Templatize encoding/decoding of Optional<T>
This was the last one! IPCCompiler no longer has any type-specific encoding/decoding logic! :^)
This commit is contained in:
parent
6800f6eff5
commit
413ab652c8
3 changed files with 29 additions and 21 deletions
|
@ -76,6 +76,15 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Encoder& operator<<(const Optional<T>& optional)
|
||||
{
|
||||
*this << optional.has_value();
|
||||
if (optional.has_value())
|
||||
*this << optional.value();
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void encode(const T& value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue