Loading base/expected_test.cpp +1 −19 Original line number Diff line number Diff line Loading @@ -499,24 +499,6 @@ TEST(Expected, testDifferentErrors) { EXPECT_TRUE(e4 != e3); } TEST(Expected, testCompareWithSameValue) { exp_int e = 10; int value = 10; EXPECT_TRUE(e == value); EXPECT_TRUE(value == e); EXPECT_FALSE(e != value); EXPECT_FALSE(value != e); } TEST(Expected, testCompareWithDifferentValue) { exp_int e = 10; int value = 20; EXPECT_FALSE(e == value); EXPECT_FALSE(value == e); EXPECT_TRUE(e != value); EXPECT_TRUE(value != e); } TEST(Expected, testCompareWithSameError) { exp_int e = unexpected(10); exp_int::unexpected_type error = 10; Loading Loading @@ -594,7 +576,7 @@ TEST(Expected, testDivideExample) { EXPECT_EQ(-1, divide(10, 0).error().cause); EXPECT_TRUE(divide(10, 3)); EXPECT_EQ(QR(3, 1), divide(10, 3)); EXPECT_EQ(QR(3, 1), *divide(10, 3)); } TEST(Expected, testPair) { Loading base/include/android-base/expected.h +0 −28 Original line number Diff line number Diff line Loading @@ -366,16 +366,6 @@ class _NODISCARD_ expected { template<class T1, class E1, class T2, class E2> friend constexpr bool operator!=(const expected<T1, E1>& x, const expected<T2, E2>& y); // comparison with T template<class T1, class E1, class T2> friend constexpr bool operator==(const expected<T1, E1>&, const T2&); template<class T1, class E1, class T2> friend constexpr bool operator==(const T2&, const expected<T1, E1>&); template<class T1, class E1, class T2> friend constexpr bool operator!=(const expected<T1, E1>&, const T2&); template<class T1, class E1, class T2> friend constexpr bool operator!=(const T2&, const expected<T1, E1>&); // Comparison with unexpected<E> template<class T1, class E1, class E2> friend constexpr bool operator==(const expected<T1, E1>&, const unexpected<E2>&); Loading Loading @@ -410,24 +400,6 @@ constexpr bool operator!=(const expected<T1, E1>& x, const expected<T2, E2>& y) return !(x == y); } // comparison with T template<class T1, class E1, class T2> constexpr bool operator==(const expected<T1, E1>& x, const T2& y) { return x.has_value() && (*x == y); } template<class T1, class E1, class T2> constexpr bool operator==(const T2& x, const expected<T1, E1>& y) { return y.has_value() && (x == *y); } template<class T1, class E1, class T2> constexpr bool operator!=(const expected<T1, E1>& x, const T2& y) { return !x.has_value() || (*x != y); } template<class T1, class E1, class T2> constexpr bool operator!=(const T2& x, const expected<T1, E1>& y) { return !y.has_value() || (x != *y); } // Comparison with unexpected<E> template<class T1, class E1, class E2> constexpr bool operator==(const expected<T1, E1>& x, const unexpected<E2>& y) { Loading init/service_parser.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ Result<void> ServiceParser::ParseKeycodes(std::vector<std::string>&& args) { // If the property is not set, it defaults to none, in which case there are no keycodes // for this service. if (expanded == "none") { if (*expanded == "none") { return {}; } Loading Loading
base/expected_test.cpp +1 −19 Original line number Diff line number Diff line Loading @@ -499,24 +499,6 @@ TEST(Expected, testDifferentErrors) { EXPECT_TRUE(e4 != e3); } TEST(Expected, testCompareWithSameValue) { exp_int e = 10; int value = 10; EXPECT_TRUE(e == value); EXPECT_TRUE(value == e); EXPECT_FALSE(e != value); EXPECT_FALSE(value != e); } TEST(Expected, testCompareWithDifferentValue) { exp_int e = 10; int value = 20; EXPECT_FALSE(e == value); EXPECT_FALSE(value == e); EXPECT_TRUE(e != value); EXPECT_TRUE(value != e); } TEST(Expected, testCompareWithSameError) { exp_int e = unexpected(10); exp_int::unexpected_type error = 10; Loading Loading @@ -594,7 +576,7 @@ TEST(Expected, testDivideExample) { EXPECT_EQ(-1, divide(10, 0).error().cause); EXPECT_TRUE(divide(10, 3)); EXPECT_EQ(QR(3, 1), divide(10, 3)); EXPECT_EQ(QR(3, 1), *divide(10, 3)); } TEST(Expected, testPair) { Loading
base/include/android-base/expected.h +0 −28 Original line number Diff line number Diff line Loading @@ -366,16 +366,6 @@ class _NODISCARD_ expected { template<class T1, class E1, class T2, class E2> friend constexpr bool operator!=(const expected<T1, E1>& x, const expected<T2, E2>& y); // comparison with T template<class T1, class E1, class T2> friend constexpr bool operator==(const expected<T1, E1>&, const T2&); template<class T1, class E1, class T2> friend constexpr bool operator==(const T2&, const expected<T1, E1>&); template<class T1, class E1, class T2> friend constexpr bool operator!=(const expected<T1, E1>&, const T2&); template<class T1, class E1, class T2> friend constexpr bool operator!=(const T2&, const expected<T1, E1>&); // Comparison with unexpected<E> template<class T1, class E1, class E2> friend constexpr bool operator==(const expected<T1, E1>&, const unexpected<E2>&); Loading Loading @@ -410,24 +400,6 @@ constexpr bool operator!=(const expected<T1, E1>& x, const expected<T2, E2>& y) return !(x == y); } // comparison with T template<class T1, class E1, class T2> constexpr bool operator==(const expected<T1, E1>& x, const T2& y) { return x.has_value() && (*x == y); } template<class T1, class E1, class T2> constexpr bool operator==(const T2& x, const expected<T1, E1>& y) { return y.has_value() && (x == *y); } template<class T1, class E1, class T2> constexpr bool operator!=(const expected<T1, E1>& x, const T2& y) { return !x.has_value() || (*x != y); } template<class T1, class E1, class T2> constexpr bool operator!=(const T2& x, const expected<T1, E1>& y) { return !y.has_value() || (x != *y); } // Comparison with unexpected<E> template<class T1, class E1, class E2> constexpr bool operator==(const expected<T1, E1>& x, const unexpected<E2>& y) { Loading
init/service_parser.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ Result<void> ServiceParser::ParseKeycodes(std::vector<std::string>&& args) { // If the property is not set, it defaults to none, in which case there are no keycodes // for this service. if (expanded == "none") { if (*expanded == "none") { return {}; } Loading