libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
expected.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2022 Kitsune Ral <Kitsune-Ral@users.sf.net>
2
// SPDX-License-Identifier: LGPL-2.1-or-later
3
4
#
pragma
once
5
6
#
include
<
expected
>
7
8
namespace
Quotient
{
9
10
template
<
typename
T,
typename
E>
11
requires (!
std
::
is_same_v
<
T
,
E
>)
12
class
[[deprecated(
"Use std::expected instead"
)]]
Expected
:
public
std
::
expected
<
T
,
E
> {
13
public
:
14
using
std
::
expected
<
T
,
E
>::
expected
;
15
16
template
<std::convertible_to<E> X>
17
explicit
(
false
)
Expected
(X&& x) :
std
::
expected
<
T
,
E
>(
std
::
unexpect
,
std
::
forward
<
X
>(
x
))
18
{}
19
20
T
&&
move_value_or
(T&& fallback)
21
{
22
if
(
this
->has_value())
23
return
std::move(
this
->value());
24
return
std::move(fallback);
25
}
26
};
27
28
}
// namespace Quotient
Quotient::Expected
Definition
expected.h:12
Quotient::Expected::explicit
explicit(false) Expected(X &&x)
Definition
expected.h:17
Quotient::Expected::move_value_or
T && move_value_or(T &&fallback)
Definition
expected.h:20
Quotient
Definition
accountregistry.h:13
Quotient
expected.h
Generated by
1.9.8