Skip to content

Commit 2295716

Browse files
authored
Merge pull request swiftlang#22702 from gottesmm/pr-28cb5eb86536c36f67f107b4a72c1a29464d4d7b
2 parents 8fa74fa + 3178f5c commit 2295716

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/swift/Basic/NullablePtr.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ class NullablePtr {
6060
const T *getPtrOrNull() const { return Ptr; }
6161

6262
explicit operator bool() const { return Ptr; }
63+
64+
bool operator==(NullablePtr<T> &&other) const { return other.Ptr == Ptr; }
65+
66+
bool operator!=(NullablePtr<T> &&other) const { return !(*this == other); }
67+
68+
bool operator==(const T *other) const { return other == Ptr; }
69+
70+
bool operator!=(const T *other) const { return !(*this == other); }
6371
};
6472

6573
} // end namespace swift

0 commit comments

Comments
 (0)