Merge branch 'master' of https://github.com/neilmacintosh/GSL into remove-move-ops

This commit is contained in:
Neil MacIntosh 2018-02-11 14:27:05 -08:00
commit 533494335b
3 changed files with 3 additions and 5 deletions

View File

@ -11,7 +11,7 @@
</Type>
<!-- 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>
<Expand>
<Item Name="[invoke]">invoke_</Item>

View File

@ -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
//

View File

@ -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++;