Merge "Upgrade Microsoft-GSL to 7e99e76c9761d0d0b0848b91f8648830670ee872"
diff --git a/METADATA b/METADATA
index 77c6f70..2ffef1c 100644
--- a/METADATA
+++ b/METADATA
@@ -5,10 +5,10 @@
     type: GIT
     value: "https://github.com/Microsoft/GSL"
   }
-  version: "3d56ba9e7f2d61fd8c9c2a7715b46fde38c00123"
+  version: "7e99e76c9761d0d0b0848b91f8648830670ee872"
   last_upgrade_date {
     year: 2019
-    month: 10
-    day: 24
+    month: 11
+    day: 25
   }
 }
diff --git a/include/gsl/gsl_byte b/include/gsl/gsl_byte
index 1670646..c2fc572 100644
--- a/include/gsl/gsl_byte
+++ b/include/gsl/gsl_byte
@@ -33,6 +33,8 @@
 
 #include <type_traits>
 
+// VS2017 15.8 added support for the __cpp_lib_byte definition
+// To do: drop _HAS_STD_BYTE when support for pre 15.8 expires
 #ifdef _MSC_VER
 
 #pragma warning(push)
@@ -42,15 +44,15 @@
 
 #ifndef GSL_USE_STD_BYTE
 // this tests if we are under MSVC and the standard lib has std::byte and it is enabled
-#if defined(_HAS_STD_BYTE) && _HAS_STD_BYTE
+#if (defined(_HAS_STD_BYTE) && _HAS_STD_BYTE) || (defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603)
 
 #define GSL_USE_STD_BYTE 1
 
-#else // defined(_HAS_STD_BYTE) && _HAS_STD_BYTE
+#else // (defined(_HAS_STD_BYTE) && _HAS_STD_BYTE) || (defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603)
 
 #define GSL_USE_STD_BYTE 0
 
-#endif // defined(_HAS_STD_BYTE) && _HAS_STD_BYTE
+#endif // (defined(_HAS_STD_BYTE) && _HAS_STD_BYTE) || (defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603)
 #endif // GSL_USE_STD_BYTE
 
 #else // _MSC_VER
diff --git a/include/gsl/pointers b/include/gsl/pointers
index 7373826..7afed1c 100644
--- a/include/gsl/pointers
+++ b/include/gsl/pointers
@@ -100,7 +100,7 @@
 
     constexpr operator T() const { return get(); }
     constexpr T operator->() const { return get(); }
-    constexpr decltype(auto) operator*() const { return *get(); } 
+    constexpr decltype(auto) operator*() const { return *get(); }
 
     // prevents compilation when someone attempts to assign a null pointer constant
     not_null(std::nullptr_t) = delete;
@@ -272,6 +272,14 @@
     return strict_not_null<std::remove_cv_t<std::remove_reference_t<T>>>{std::forward<T>(t)};
 }
 
+#if ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) )
+
+// deduction guides to prevent the ctad-maybe-unsupported warning
+template <class T> not_null(T) -> not_null<T>;
+template <class T> strict_not_null(T) -> strict_not_null<T>;
+
+#endif // ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) )
+
 } // namespace gsl
 
 namespace std
diff --git a/tests/no_exception_ensure_tests.cpp b/tests/no_exception_ensure_tests.cpp
index b1ae15b..2ec0ebb 100644
--- a/tests/no_exception_ensure_tests.cpp
+++ b/tests/no_exception_ensure_tests.cpp
@@ -28,7 +28,7 @@
 

 void setup_termination_handler() noexcept

 {

-#if defined(_MSC_VER)

+#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)

 

     auto& handler = gsl::details::get_terminate_handler();

     handler = &test_terminate;

diff --git a/tests/no_exception_throw_tests.cpp b/tests/no_exception_throw_tests.cpp
index b28ad00..ddb6b07 100644
--- a/tests/no_exception_throw_tests.cpp
+++ b/tests/no_exception_throw_tests.cpp
@@ -28,7 +28,7 @@
 

 void setup_termination_handler() noexcept

 {

-#if defined(_MSC_VER)

+#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)

 

     auto& handler = gsl::details::get_terminate_handler();

     handler = &test_terminate;