refactor(result): add value comparison operators

This commit is contained in:
2026-06-02 16:03:38 +02:00
parent d422b80907
commit 3491f9aebb
+16
View File
@@ -199,6 +199,22 @@ public:
*/ */
bool operator!=(const result& rhs) const { return !this->operator==(rhs); } bool operator!=(const result& rhs) const { return !this->operator==(rhs); }
/**
* @brief Compares a result with a value for equality.
*
* @param rhs Value to compare against.
* @return true if the values are equal.
*/
bool operator==(const value_type& rhs) const { return !m_error && !rhs.m_error && m_value.result == rhs; }
/**
* @brief Compares a result with a value for inequality.
*
* @param rhs Value to compare against.
* @return true if the values are not equal.
*/
bool operator!=(const value_type& rhs) const { return !this->operator==(rhs); }
/** /**
* @brief Returns a reference to value. * @brief Returns a reference to value.
* *