aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericLemanissier <ericLemanissier@users.noreply.github.com>2018-05-03 08:08:41 +0200
committerGitHub <noreply@github.com>2018-05-03 08:08:41 +0200
commit423841e965ee72a474f176b16b79ce421549d5b9 (patch)
tree8b855cde5489dda05b81097aa44ad9c11c6982df
parent5cbde3008aa43a9c5f6c219ee15b8388336d4433 (diff)
downloadplatform_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/pointers2
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))