Summary: [Folly] instance Eq Unit
Unit::operator==(const Unit&)
Unit::operator!=(const Unit&)
Reviewed By: @Gownta
Differential Revision:
D2179384
template <class T> struct Lift : public std::false_type {
using type = T;
};
+ bool operator==(const Unit& other) const { return true; }
+ bool operator!=(const Unit& other) const { return false; }
};
// Lift void into Unit.
Future<Unit>();
}
+TEST(Unit, operatorEq) {
+ EXPECT_TRUE(Unit{} == Unit{});
+}
+
+TEST(Unit, operatorNe) {
+ EXPECT_FALSE(Unit{} != Unit{});
+}
+
TEST(Unit, voidOrUnit) {
EXPECT_TRUE(is_void_or_unit<void>::value);
EXPECT_TRUE(is_void_or_unit<Unit>::value);