xo-object: spaceship operator for gp<T> + gp<String>
This commit is contained in:
parent
6c334d91d7
commit
3f9fac65a4
1 changed files with 12 additions and 0 deletions
|
|
@ -69,6 +69,18 @@ namespace xo {
|
|||
T * operator->() const { return ptr_; }
|
||||
T & operator*() const { return *ptr_; }
|
||||
|
||||
auto operator<=>(gc_ptr<T> other) const
|
||||
requires std::three_way_comparable<T>
|
||||
{
|
||||
return *ptr_ <=> *other.ptr_;
|
||||
}
|
||||
|
||||
bool operator==(gc_ptr<T> other) const
|
||||
requires std::equality_comparable<T>
|
||||
{
|
||||
return *ptr_ == *other.ptr_;
|
||||
}
|
||||
|
||||
private:
|
||||
T * ptr_ = nullptr;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue