Skip to content

Commit

Permalink
reference_counted comparison with nullptr_t
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbrq committed Sep 29, 2023
1 parent 9694727 commit 7d1a851
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/cxxdes/misc/reference_counted.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ struct ptr {
return valid();
}

bool operator==(std::nullptr_t) {
return !valid();
}

T *get() noexcept {
return ptr_;
}
Expand Down

0 comments on commit 7d1a851

Please sign in to comment.