From 8e481ebe19e1113fddfeeaa6734cb58a5ae1b69f Mon Sep 17 00:00:00 2001 From: "Jordan Maples [MSFT]" <49793787+JordanMaples@users.noreply.github.com> Date: Fri, 15 Nov 2019 14:41:38 -0800 Subject: [PATCH] adding deduction guide for strict_not_null --- include/gsl/pointers | 17 ++++++++++------- 1 file 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 -not_null(T ptr) -> not_null; - -#endif // (defined(__cplusplus) && (__cplusplus >= 201703L)) - template auto make_not_null(T&& t) { return not_null>>{std::forward(t)}; @@ -279,6 +272,16 @@ auto make_strict_not_null(T&& t) { return strict_not_null>>{std::forward(t)}; } +#if (defined(__cplusplus) && (__cplusplus >= 201703L)) + +// deduction guides to prevent the ctad-maybe-unsupported warning +template +not_null(T ptr) -> not_null; +template +strict_not_null(T ptr) -> strict_not_null; + +#endif // (defined(__cplusplus) && (__cplusplus >= 201703L)) + } // namespace gsl namespace std