mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 10:21:04 +01:00
Add equality comparisons to Ptr (#774)
This commit is contained in:
@@ -32,6 +32,9 @@ class Ptr {
|
||||
|
||||
T* Get() const { return ptr; }
|
||||
|
||||
friend auto operator==(Ptr lhs, Ptr rhs) { return lhs.ptr == rhs.ptr; }
|
||||
friend auto operator!=(Ptr lhs, Ptr rhs) { return lhs.ptr != rhs.ptr; }
|
||||
|
||||
private:
|
||||
T* ptr;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user