mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
explicit not_null constructor
This commit is contained in:
parent
b07383ead1
commit
be12a61e7f
2
gsl/gsl
2
gsl/gsl
@ -78,7 +78,7 @@ class not_null
|
||||
static_assert(std::is_assignable<T&, std::nullptr_t>::value, "T cannot be assigned nullptr.");
|
||||
|
||||
public:
|
||||
not_null(T t) : ptr_(t) { ensure_invariant(); }
|
||||
explicit not_null(T t) : ptr_(t) { ensure_invariant(); }
|
||||
not_null& operator=(const T& t)
|
||||
{
|
||||
ptr_ = t;
|
||||
|
Loading…
Reference in New Issue
Block a user