mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Merge from upstream master.
This commit is contained in:
commit
f63fe12ba7
@ -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<*>">
|
<Type Name="gsl::final_action<*>">
|
||||||
<DisplayString>{{ invoke = {invoke_}, action = {f_} }}</DisplayString>
|
<DisplayString>{{ invoke = {invoke_}, action = {f_} }}</DisplayString>
|
||||||
<Expand>
|
<Expand>
|
||||||
<Item Name="[invoke]">invoke_</Item>
|
<Item Name="[invoke]">invoke_</Item>
|
||||||
|
@ -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
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -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++;
|
||||||
|
Loading…
Reference in New Issue
Block a user