not_null constructor is now explicit (#659)

solves #395
This commit is contained in:
ericLemanissier
2018-04-25 04:11:43 +02:00
committed by Anna Gringauze
parent fbe867a9c4
commit 2fc94db3eb
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ public:
static_assert(std::is_assignable<T&, std::nullptr_t>::value, "T cannot be assigned nullptr.");
template <typename U, typename = std::enable_if_t<std::is_convertible<U, T>::value>>
constexpr not_null(U&& u) : ptr_(std::forward<U>(u))
constexpr explicit not_null(U&& u) : ptr_(std::forward<U>(u))
{
Expects(ptr_ != nullptr);
}