From 6c6111acb7b5d687ac006969ac96e5b1f21374cd Mon Sep 17 00:00:00 2001 From: dmitrykobets-msft <89153909+dmitrykobets-msft@users.noreply.github.com> Date: Wed, 14 Dec 2022 18:16:52 -0800 Subject: [PATCH] Remove null check inside not_null::get (#1067) 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 --- include/gsl/pointers | 1 - 1 file changed, 1 deletion(-) diff --git a/include/gsl/pointers b/include/gsl/pointers index 17c756b..633c6c6 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -117,7 +117,6 @@ public: not_null& operator=(const not_null& other) = default; constexpr details::value_or_reference_return_t get() const { - Ensures(ptr_ != nullptr); return ptr_; }