diff options
| author | ericLemanissier <ericLemanissier@users.noreply.github.com> | 2018-05-03 08:08:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-03 08:08:41 +0200 |
| commit | 423841e965ee72a474f176b16b79ce421549d5b9 (patch) | |
| tree | 8b855cde5489dda05b81097aa44ad9c11c6982df | |
| parent | 5cbde3008aa43a9c5f6c219ee15b8388336d4433 (diff) | |
| download | platform_external_Microsoft-GSL-423841e965ee72a474f176b16b79ce421549d5b9.tar.gz platform_external_Microsoft-GSL-423841e965ee72a474f176b16b79ce421549d5b9.tar.bz2 platform_external_Microsoft-GSL-423841e965ee72a474f176b16b79ce421549d5b9.zip | |
fix requirement on not_null template
it should be comparable to nullptr, it does not have to be assignable
| -rw-r--r-- | include/gsl/pointers | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/gsl/pointers b/include/gsl/pointers index ad15ce3..891dfc5 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -69,7 +69,7 @@ template <class T> class not_null { 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>> constexpr explicit not_null(U&& u) : ptr_(std::forward<U>(u)) |
