You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are thinking of revising the gsl::not_null threat-model to reserve all nullness checking to the constructor, and to trust all created instances post-construction:
not_null<int*> a = some_pointer; // check that some_pointer is not null in a's constructorint* b = a.get(); // no need to check that `a.ptr_` is not null; it's already been checked in a's constructor
not_null<int*> other = a; // no need to check that `a.ptr_` is not null; it's already been checked in a's constructor. // transitively, `other._ptr_` will now also be trusted
This change will remove many existing runtime checks that occur inside gsl::not_null, notably the one inside not_null::get(), and will overall simplify the design of the gsl::not_null type.
The text was updated successfully, but these errors were encountered:
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
We are thinking of revising the gsl::not_null threat-model to reserve all nullness checking to the constructor, and to trust all created instances post-construction:
This change will remove many existing runtime checks that occur inside
gsl::not_null
, notably the one insidenot_null::get()
, and will overall simplify the design of thegsl::not_null
type.The text was updated successfully, but these errors were encountered: