Merge from upstream master.

This commit is contained in:
Neil MacIntosh 2018-02-11 13:36:18 -08:00
commit f63fe12ba7
3 changed files with 3 additions and 5 deletions

View File

@ -11,7 +11,7 @@
</Type> </Type>
<!-- These types are from the gsl_util header. --> <!-- These types are from the gsl_util header. -->
<Type Name="gsl::final_act&lt;*&gt;"> <Type Name="gsl::final_action&lt;*&gt;">
<DisplayString>{{ invoke = {invoke_}, action = {f_} }}</DisplayString> <DisplayString>{{ invoke = {invoke_}, action = {f_} }}</DisplayString>
<Expand> <Expand>
<Item Name="[invoke]">invoke_</Item> <Item Name="[invoke]">invoke_</Item>

View File

@ -52,12 +52,10 @@
// //
#ifdef _MSC_VER #ifdef _MSC_VER
#define GSL_ASSUME(cond) __assume(cond) #define GSL_ASSUME(cond) __assume(cond)
#elif defined(__clang__)
#define GSL_ASSUME(cond) __builtin_assume(cond)
#elif defined(__GNUC__) #elif defined(__GNUC__)
#define GSL_ASSUME(cond) ((cond) ? static_cast<void>(0) : __builtin_unreachable()) #define GSL_ASSUME(cond) ((cond) ? static_cast<void>(0) : __builtin_unreachable())
#else #else
#define GSL_ASSUME(cond) static_cast<void>(!!(cond)) #define GSL_ASSUME(cond) static_cast<void>((cond) ? 0 : 0)
#endif #endif
// //

View File

@ -98,7 +98,7 @@ namespace details
{ {
if (str == nullptr || n <= 0) return 0; 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; std::ptrdiff_t len = 0;
while (len < n && str_span[len]) len++; while (len < n && str_span[len]) len++;