Skip to content

Commit

Permalink
Remove null check inside not_null::get (#1067)
Browse files Browse the repository at this point in the history
Guidelines issue 2006 removes the null check inside not_null::get, since the contained pointer is already guaranteed to be not-null upon construction.

Resolves #1051
  • Loading branch information
dmitrykobets-msft authored Dec 15, 2022
1 parent f3620bb commit 6c6111a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion include/gsl/pointers
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public:
not_null& operator=(const not_null& other) = default;
constexpr details::value_or_reference_return_t<T> get() const
{
Ensures(ptr_ != nullptr);
return ptr_;
}

Expand Down

0 comments on commit 6c6111a

Please sign in to comment.