mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 14:02:51 +00:00
When an IPC message returns a single value, we generate a class with a
constructor that is something like:
class MessageResponse {
MessageResponse(SingleReturnType value)
: m_value(move(value))
{
}
};
If that IPC message wants to return a value that SingleReturnType is
constructible from, you have to wrap that return call with braces:
return { value_that_could_construct_single_return_type };
That isn't really an issue except for when we want to mix TRY semantics
with the return type. If SingleReturnType is constructible from an Error
type (i.e. something similar to ErrorOr), the following doesn't work:
TRY(fallible_function());
Because MessageResponse would not be constructible from Error. Instead,
we must do some workaround with a custom TRY macro, as in
|
||
---|---|---|
.. | ||
IPCCompiler | ||
LibEDID | ||
LibLocale | ||
LibTimeZone | ||
LibUnicode | ||
LibWeb | ||
StateMachineGenerator | ||
CMakeLists.txt |