diff --git a/expected.h b/expected.h index 9beedf6..7b864e3 100644 --- a/expected.h +++ b/expected.h @@ -22,14 +22,14 @@ public: {} - Expected(const Expected& ths) + Expected(const Expected& rhs) : m_valid(rhs.valid) { if (m_valid) { - new (&m_value) T(rhs.ham); + new (&m_value) T(rhs.m_value); } 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); new(&rhs.m_value) T(std::move(m_value)); new(&m_error) std::exception_ptr(t); - std::swap(m_valid, rhs.getHam); + std::swap(m_valid, rhs.m_valid); } } else {