aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Maples <jomaples@microsoft.com>2020-10-01 14:16:01 -0700
committerJordan Maples <jomaples@microsoft.com>2020-10-01 14:16:01 -0700
commit3f68a0034a4ab73f1bf21dae2be8895e81e16ab0 (patch)
tree9f02b2bd8bdf02abe1b09695fa2079cb9253a277
parent7721de88f3f72bc41efc7b902098eb24da3bab3d (diff)
downloadMicrosoft-GSL-3f68a0034a4ab73f1bf21dae2be8895e81e16ab0.tar.gz
fixed botched formatting
-rw-r--r--include/gsl/string_span28
1 files changed, 19 insertions, 9 deletions
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<std::size_t>(-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<std::size_t>(cur - seq) < max && *cur != Sentinel) ++cur;
Ensures(*cur == Sentinel);
return {seq, static_cast<std::size_t>(cur - seq)};
@@ -163,9 +166,12 @@ constexpr span<CharT, dynamic_extent> ensure_z(CharT (&sz)[N])
}
template <class Cont>
-[[deprecated("string_span was removed from the C++ Core Guidelines. For more information, see "
- "isocpp/CppCoreGuidelines PR#1680")]] constexpr span<
- typename std::remove_pointer<typename Cont::pointer>::type, dynamic_extent>
+[[deprecated(
+ "string_span was removed from the C++ Core Guidelines. For more information, see "
+ "isocpp/CppCoreGuidelines PR#1680")]] constexpr span<typename std::
+ remove_pointer<
+ typename Cont::pointer>::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 <class Traits, class Allocator>
- // GSL_SUPPRESS(bounds.4) // NO-FORMAT: attribute // TODO: parser bug
+ // GSL_SUPPRESS(bounds.4) // TODO: parser bug
constexpr basic_string_span(std::basic_string<element_type, Traits, Allocator> & str)
: span_(&str[0], str.length())
{}
@@ -410,7 +416,9 @@ template <class ElementType, std::size_t Extent>
constexpr basic_string_span<const byte, details::calculate_byte_size<ElementType, Extent>::value>
as_bytes(basic_string_span<ElementType, Extent> s) noexcept
{
- GSL_SUPPRESS(type .1) // NO-FORMAT: attribute
+ // clang-format off
+ GSL_SUPPRESS(type.1)
+ // clang-format on
return {reinterpret_cast<const byte*>(s.data()), s.size_bytes()};
}
@@ -419,7 +427,9 @@ template <class ElementType, std::size_t Extent,
constexpr basic_string_span<byte, details::calculate_byte_size<ElementType, Extent>::value>
as_writable_bytes(basic_string_span<ElementType, Extent> s) noexcept
{
- GSL_SUPPRESS(type .1) // NO-FORMAT: attribute
+ // clang-format off
+ GSL_SUPPRESS(type.1)
+ // clang-format on
return {reinterpret_cast<byte*>(s.data()), s.size_bytes()};
}