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
This commit is contained in:
dmitrykobets-msft 2022-12-14 18:16:52 -08:00 committed by GitHub
parent f3620bb009
commit 6c6111acb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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_;
}