diff --git a/GSL.natvis b/GSL.natvis index e40a8c9..a467a17 100644 --- a/GSL.natvis +++ b/GSL.natvis @@ -11,7 +11,7 @@ - + {{ invoke = {invoke_}, action = {f_} }} invoke_ 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(0) : __builtin_unreachable()) #else -#define GSL_ASSUME(cond) static_cast(!!(cond)) +#define GSL_ASSUME(cond) static_cast((cond) ? 0 : 0) #endif // diff --git a/include/gsl/string_span b/include/gsl/string_span index 42f8975..0c9f2cf 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 str_span{str, n}; + const span str_span{str, n}; std::ptrdiff_t len = 0; while (len < n && str_span[len]) len++;