diff --git a/include/gsl/string_span b/include/gsl/string_span index 6fedad7..78a9cb0 100644 --- a/include/gsl/string_span +++ b/include/gsl/string_span @@ -133,12 +133,15 @@ ensure_sentinel(T* seq, std::size_t max = static_cast(-1)) { Ensures(seq != nullptr); - GSL_SUPPRESS( - f .23) // NO-FORMAT: attribute // TODO: false positive // TODO: suppress does not work + // clang-format off + GSL_SUPPRESS(f.23) // TODO: false positive // TODO: suppress does not work + // clang-format on auto cur = seq; Ensures(cur != nullptr); // workaround for removing the warning - GSL_SUPPRESS(bounds .1) // NO-FORMAT: attribute // TODO: suppress does not work + // clang-format off + GSL_SUPPRESS(bounds.1) // TODO: suppress does not work + // clang-format on while (static_cast(cur - seq) < max && *cur != Sentinel) ++cur; Ensures(*cur == Sentinel); return {seq, static_cast(cur - seq)}; @@ -163,9 +166,12 @@ constexpr span ensure_z(CharT (&sz)[N]) } template -[[deprecated("string_span was removed from the C++ Core Guidelines. For more information, see " - "isocpp/CppCoreGuidelines PR#1680")]] constexpr span< - typename std::remove_pointer::type, dynamic_extent> +[[deprecated( + "string_span was removed from the C++ Core Guidelines. For more information, see " + "isocpp/CppCoreGuidelines PR#1680")]] constexpr span::type, + dynamic_extent> ensure_z(Cont& cont) { return ensure_z(cont.data(), cont.size()); @@ -243,7 +249,7 @@ public: // Container signature should work for basic_string after C++17 version exists template - // GSL_SUPPRESS(bounds.4) // NO-FORMAT: attribute // TODO: parser bug + // GSL_SUPPRESS(bounds.4) // TODO: parser bug constexpr basic_string_span(std::basic_string & str) : span_(&str[0], str.length()) {} @@ -410,7 +416,9 @@ template constexpr basic_string_span::value> as_bytes(basic_string_span s) noexcept { - GSL_SUPPRESS(type .1) // NO-FORMAT: attribute + // clang-format off + GSL_SUPPRESS(type.1) + // clang-format on return {reinterpret_cast(s.data()), s.size_bytes()}; } @@ -419,7 +427,9 @@ template ::value> as_writable_bytes(basic_string_span s) noexcept { - GSL_SUPPRESS(type .1) // NO-FORMAT: attribute + // clang-format off + GSL_SUPPRESS(type.1) + // clang-format on return {reinterpret_cast(s.data()), s.size_bytes()}; }