mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Merge pull request #676 from ericLemanissier/patch-3
fix requirement on not_null template
This commit is contained in:
commit
ef714fa49e
@ -63,7 +63,7 @@ template <class T>
|
|||||||
class not_null
|
class not_null
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static_assert(std::is_assignable<T&, std::nullptr_t>::value, "T cannot be assigned nullptr.");
|
static_assert(std::is_convertible<decltype(std::declval<T>() != nullptr), bool>::value, "T cannot be compared to nullptr.");
|
||||||
|
|
||||||
template <typename U, typename = std::enable_if_t<std::is_convertible<U, T>::value>>
|
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 not_null(U&& u) : ptr_(std::forward<U>(u))
|
||||||
|
Loading…
Reference in New Issue
Block a user