Fix: some typos and refactoring errors in expected
This commit is contained in:
parent
a32e2c83ca
commit
cb237b0c52
1 changed files with 4 additions and 4 deletions
|
|
@ -22,14 +22,14 @@ public:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Expected(const Expected& ths)
|
Expected(const Expected& rhs)
|
||||||
: m_valid(rhs.valid)
|
: m_valid(rhs.valid)
|
||||||
{
|
{
|
||||||
if (m_valid) {
|
if (m_valid) {
|
||||||
new (&m_value) T(rhs.ham);
|
new (&m_value) T(rhs.m_value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
new (&m_error) std::exception_ptr(rhs.spam);
|
new (&m_error) std::exception_ptr(rhs.m_error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ public:
|
||||||
auto t = std::move(rhs.m_error);
|
auto t = std::move(rhs.m_error);
|
||||||
new(&rhs.m_value) T(std::move(m_value));
|
new(&rhs.m_value) T(std::move(m_value));
|
||||||
new(&m_error) std::exception_ptr(t);
|
new(&m_error) std::exception_ptr(t);
|
||||||
std::swap(m_valid, rhs.getHam);
|
std::swap(m_valid, rhs.m_valid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue