mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:27:45 +00:00
Kernel: Port more code to KResult and KResultOr<T>.
This commit is contained in:
parent
3079ef01ce
commit
028afabf6b
15 changed files with 155 additions and 198 deletions
|
@ -34,6 +34,19 @@ public:
|
|||
new (&m_storage) T(move(value));
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
KResultOr(U&& value)
|
||||
{
|
||||
new (&m_storage) T(move(value));
|
||||
}
|
||||
|
||||
KResultOr(KResultOr&& other)
|
||||
{
|
||||
new (&m_storage) T(move(other.value()));
|
||||
other.m_is_error = true;
|
||||
other.m_error = KSuccess;
|
||||
}
|
||||
|
||||
~KResultOr()
|
||||
{
|
||||
if (!m_is_error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue