diff --git a/include/gsl.h b/include/gsl.h index 8db781b..c9fb2d2 100644 --- a/include/gsl.h +++ b/include/gsl.h @@ -113,6 +113,18 @@ public: operator T() const { return get(); } T operator->() const { return get(); } + template ::value>> + bool operator==(const not_null& rhs) const + { + return ptr_ == rhs.get(); + } + + template ::value>> + bool operator != (const not_null& rhs) const + { + return !(*this == rhs.get()); + } + bool operator==(const T& rhs) const { return ptr_ == rhs; } bool operator!=(const T& rhs) const { return !(*this == rhs); }