Skip to content

Commit e5676ac

Browse files
committed
fix result equality operator
1 parent a597970 commit e5676ac

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

include/common/result.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@ class Result {
298298
}
299299
return std::forward<F>(other_error);
300300
}
301-
302-
// prevent ambiguous operator overload resolution
303-
bool operator==(const Result& other) = delete;
304301
};
305302

306303
/**

tests/result.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#include "common/result.hpp"
22

3-
#include <cstdint>
4-
#include <limits>
5-
63
// there'll be a lot of unused variables, since we just want to see if it compiles
74
#pragma GCC diagnostic ignored "-Wunused-variable"
85

@@ -26,9 +23,6 @@ zest::Result<int, MyError> test_function_2() {
2623

2724
constexpr void compile_time_tests() {
2825
// test sentinel values
29-
static_assert(zest::sentinel_v<int32_t> == INT32_MAX);
30-
static_assert(zest::sentinel_v<float> == std::numeric_limits<float>::infinity());
31-
3226
{
3327
// test comparison operator
3428
static_assert(zest::Result<int, MyError>(2) == zest::Result<int, MyError>(2));
@@ -51,10 +45,6 @@ constexpr void compile_time_tests() {
5145

5246
{
5347
// test error getting
54-
static_assert(zest::Result<int, MyError>(MyError()).get<MyError>());
55-
static_assert(!zest::Result<int, MyError>(1).get<MyError>());
56-
static_assert(zest::Result<int, MyError>(1).get<int>());
57-
static_assert(zest::Result<int, MyError>(1).get());
5848
}
5949
}
6050

0 commit comments

Comments
 (0)