aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com>2019-10-25 11:42:01 -0700
committerGitHub <noreply@github.com>2019-10-25 11:42:01 -0700
commit9939d5889bc2bcde2ac17a026313d0960d6d799a (patch)
treeea41216978b60a4a50279413916e6e3ab9b4b3f7
parent3d56ba9e7f2d61fd8c9c2a7715b46fde38c00123 (diff)
parent22cba52114afa8b5809cffd0d7925eebf7170a33 (diff)
downloadplatform_external_Microsoft-GSL-9939d5889bc2bcde2ac17a026313d0960d6d799a.tar.gz
platform_external_Microsoft-GSL-9939d5889bc2bcde2ac17a026313d0960d6d799a.tar.bz2
platform_external_Microsoft-GSL-9939d5889bc2bcde2ac17a026313d0960d6d799a.zip
Merge pull request #822 from JordanMaples/dev/jomaples/lib-byte-check
gsl_byte to inspect __cpp_lib_byte
-rw-r--r--include/gsl/gsl_byte8
1 files changed, 5 insertions, 3 deletions
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