aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeil MacIntosh <neilmac@fb.com>2018-02-11 14:27:05 -0800
committerNeil MacIntosh <neilmac@fb.com>2018-02-11 14:27:05 -0800
commit533494335b854eb954b9fb9205b37ce628bd7fca (patch)
treed3f32801936c2da89edda8a15aebd0fb30070dff /include
parent5538021e76cf3ebfc1138a1c2fbe345fc08dc8c5 (diff)
parentf63fe12ba757d294b94c4517f08301750a29c401 (diff)
downloadplatform_external_Microsoft-GSL-533494335b854eb954b9fb9205b37ce628bd7fca.tar.gz
platform_external_Microsoft-GSL-533494335b854eb954b9fb9205b37ce628bd7fca.tar.bz2
platform_external_Microsoft-GSL-533494335b854eb954b9fb9205b37ce628bd7fca.zip
Merge branch 'master' of https://github.com/neilmacintosh/GSL into remove-move-ops
Diffstat (limited to 'include')
-rw-r--r--include/gsl/gsl_assert4
-rw-r--r--include/gsl/string_span2
2 files changed, 2 insertions, 4 deletions
diff --git a/include/gsl/gsl_assert b/include/gsl/gsl_assert
index 468d4a0..eeb3473 100644
--- a/include/gsl/gsl_assert
+++ b/include/gsl/gsl_assert
@@ -52,12 +52,10 @@
//
#ifdef _MSC_VER
#define GSL_ASSUME(cond) __assume(cond)
-#elif defined(__clang__)
-#define GSL_ASSUME(cond) __builtin_assume(cond)
#elif defined(__GNUC__)
#define GSL_ASSUME(cond) ((cond) ? static_cast<void>(0) : __builtin_unreachable())
#else
-#define GSL_ASSUME(cond) static_cast<void>(!!(cond))
+#define GSL_ASSUME(cond) static_cast<void>((cond) ? 0 : 0)
#endif
//
diff --git a/include/gsl/string_span b/include/gsl/string_span
index eb4c707..cd9ddf9 100644
--- a/include/gsl/string_span
+++ b/include/gsl/string_span
@@ -98,7 +98,7 @@ namespace details
{
if (str == nullptr || n <= 0) return 0;
- span<const CharT> str_span{str, n};
+ const span<const CharT> str_span{str, n};
std::ptrdiff_t len = 0;
while (len < n && str_span[len]) len++;