Refactor Optional::operator==

This commit is contained in:
Maxime Coste 2016-07-04 19:19:40 +01:00
parent e262dc1257
commit ca7f647562

View File

@ -51,13 +51,8 @@ public:
bool operator==(const Optional& other) const
{
if (m_valid == other.m_valid)
{
if (m_valid)
return m_value == other.m_value;
return true;
}
return false;
return m_valid == other.m_valid and
(not m_valid or m_value == other.m_value);
}
template<typename... Args>