diff options
author | Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com> | 2019-11-15 14:41:38 -0800 |
---|---|---|
committer | Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com> | 2019-11-15 14:41:38 -0800 |
commit | 8e481ebe19e1113fddfeeaa6734cb58a5ae1b69f (patch) | |
tree | a204d4353cf248b2f2317df65f3a099585ee0f3b /include | |
parent | 4610f26b33525ad17153b8dc5d754cf254fa33c6 (diff) | |
download | platform_external_Microsoft-GSL-8e481ebe19e1113fddfeeaa6734cb58a5ae1b69f.tar.gz platform_external_Microsoft-GSL-8e481ebe19e1113fddfeeaa6734cb58a5ae1b69f.tar.bz2 platform_external_Microsoft-GSL-8e481ebe19e1113fddfeeaa6734cb58a5ae1b69f.zip |
adding deduction guide for strict_not_null
Diffstat (limited to 'include')
-rw-r--r-- | include/gsl/pointers | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/gsl/pointers b/include/gsl/pointers index f1c831e..f96d064 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -119,13 +119,6 @@ private: T ptr_; }; -#if (defined(__cplusplus) && (__cplusplus >= 201703L)) -// deduction guide to prevent the ctad-maybe-unsupported warning -template <class T> -not_null(T ptr) -> not_null<T>; - -#endif // (defined(__cplusplus) && (__cplusplus >= 201703L)) - template <class T> auto make_not_null(T&& t) { return not_null<std::remove_cv_t<std::remove_reference_t<T>>>{std::forward<T>(t)}; @@ -279,6 +272,16 @@ auto make_strict_not_null(T&& t) { return strict_not_null<std::remove_cv_t<std::remove_reference_t<T>>>{std::forward<T>(t)}; } +#if (defined(__cplusplus) && (__cplusplus >= 201703L)) + +// deduction guides to prevent the ctad-maybe-unsupported warning +template <class T> +not_null(T ptr) -> not_null<T>; +template <class T> +strict_not_null(T ptr) -> strict_not_null<T>; + +#endif // (defined(__cplusplus) && (__cplusplus >= 201703L)) + } // namespace gsl namespace std |