explicit not_null constructor

This commit is contained in:
Andrzej Krzemieński 2016-10-24 10:50:18 +02:00 committed by GitHub
parent b07383ead1
commit be12a61e7f

View File

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