@@ -163,9 +163,7 @@ namespace details
163163 constexpr span_iterator& operator++() noexcept
164164 {
165165 Expects(current_ != end_);
166- // clang-format off
167- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
168- // clang-format on
166+ GSL_SUPPRESS(bounds.1)
169167 ++current_;
170168 return *this;
171169 }
@@ -196,9 +194,7 @@ namespace details
196194 if (n != 0) Expects(begin_ && current_ && end_);
197195 if (n > 0) Expects(end_ - current_ >= n);
198196 if (n < 0) Expects(current_ - begin_ >= -n);
199- // clang-format off
200- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
201- // clang-format on
197+ GSL_SUPPRESS(bounds.1)
202198 current_ += n;
203199 return *this;
204200 }
@@ -315,9 +311,7 @@ namespace details
315311 if (n < 0) Expects(current_ - begin_ >= -n);
316312 }
317313
318- // clang-format off
319- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
320- // clang-format on
314+ GSL_SUPPRESS(bounds.1)
321315 constexpr pointer _Unwrapped() const noexcept
322316 { // after seeking *this to a high water mark, or using one of the
323317 // _Verify_xxx functions above, unwrap this span_iterator to a raw
@@ -332,9 +326,7 @@ namespace details
332326#else
333327 static constexpr bool _Unwrap_when_unverified = false;
334328#endif
335- // clang-format off
336- GSL_SUPPRESS(con.3) // NO-FORMAT: attribute // TODO: false positive
337- // clang-format on
329+ GSL_SUPPRESS(con.3) // TODO: false positive
338330 constexpr void _Seek_to(const pointer p) noexcept
339331 { // adjust the position of *this to previously verified location p
340332 // after _Unwrapped
@@ -349,7 +341,8 @@ namespace details
349341 template <typename Ptr>
350342 friend struct std::pointer_traits;
351343 };
352- }} // namespace gsl::details
344+ } // namespace details
345+ } // namespace gsl
353346
354347namespace std
355348{
@@ -364,7 +357,10 @@ struct pointer_traits<::gsl::details::span_iterator<Type>>
364357};
365358} // namespace std
366359
367- namespace gsl { namespace details {
360+ namespace gsl
361+ {
362+ namespace details
363+ {
368364 template <std::size_t Ext>
369365 class extent_type
370366 {
@@ -589,10 +585,8 @@ public:
589585 }
590586
591587 template <std::size_t Count>
592- // clang-format off
593- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
594- // clang-format on
595- constexpr span<element_type, Count> last() const noexcept
588+ GSL_SUPPRESS(bounds.1)
589+ constexpr span<element_type, Count> last() const noexcept
596590 {
597591 static_assert(Extent == dynamic_extent || Count <= Extent,
598592 "last() cannot extract more elements from a span than it contains.");
@@ -601,10 +595,8 @@ public:
601595 }
602596
603597 template <std::size_t Offset, std::size_t Count = dynamic_extent>
604- // clang-format off
605- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
606- // clang-format on
607- constexpr auto subspan() const noexcept ->
598+ GSL_SUPPRESS(bounds.1)
599+ constexpr auto subspan() const noexcept ->
608600 typename details::calculate_subspan_type<ElementType, Extent, Offset, Count>::type
609601 {
610602 static_assert(Extent == dynamic_extent || (Extent >= Offset && (Count == dynamic_extent ||
@@ -642,9 +634,7 @@ public:
642634 constexpr bool empty() const noexcept { return size() == 0; }
643635
644636 // [span.elem], span element access
645- // clang-format off
646- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
647- // clang-format on
637+ GSL_SUPPRESS(bounds.1)
648638 constexpr reference operator[](size_type idx) const noexcept
649639 {
650640 Expects(idx < size());
@@ -669,18 +659,14 @@ public:
669659 constexpr iterator begin() const noexcept
670660 {
671661 const auto data = storage_.data();
672- // clang-format off
673- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
674- // clang-format on
662+ GSL_SUPPRESS(bounds.1)
675663 return {data, data + size(), data};
676664 }
677665
678666 constexpr iterator end() const noexcept
679667 {
680668 const auto data = storage_.data();
681- // clang-format off
682- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
683- // clang-format on
669+ GSL_SUPPRESS(bounds.1)
684670 const auto endData = data + storage_.size();
685671 return {data, endData, endData};
686672 }
@@ -693,9 +679,7 @@ public:
693679 constexpr pointer _Unchecked_begin() const noexcept { return data(); }
694680 constexpr pointer _Unchecked_end() const noexcept
695681 {
696- // clang-format off
697- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
698- // clang-format on
682+ GSL_SUPPRESS(bounds.1)
699683 return data() + size();
700684 }
701685#endif // _MSC_VER
@@ -752,9 +736,7 @@ private:
752736 return tmp.subspan(offset, count);
753737 }
754738
755- // clang-format off
756- GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
757- // clang-format on
739+ GSL_SUPPRESS(bounds.1)
758740 constexpr span<element_type, dynamic_extent>
759741 make_subspan(size_type offset, size_type count, subspan_selector<dynamic_extent>) const noexcept
760742 {
@@ -792,7 +774,9 @@ span(const Container&) -> span<Element>;
792774#if defined(GSL_USE_STATIC_CONSTEXPR_WORKAROUND)
793775#if defined(__clang__) && defined(_MSC_VER) && defined(__cplusplus) && (__cplusplus < 201703L)
794776#pragma clang diagnostic push
795- #pragma clang diagnostic ignored "-Wdeprecated" // Bug in clang-cl.exe which raises a C++17 -Wdeprecated warning about this static constexpr workaround in C++14 mode.
777+ #pragma clang diagnostic ignored \
778+ "-Wdeprecated" // Bug in clang-cl.exe which raises a C++17 -Wdeprecated warning about this
779+ // static constexpr workaround in C++14 mode.
796780#endif // defined(__clang__) && defined(_MSC_VER) && defined(__cplusplus) && (__cplusplus < 201703L)
797781template <class ElementType, std::size_t Extent>
798782constexpr const typename span<ElementType, Extent>::size_type span<ElementType, Extent>::extent;
@@ -827,11 +811,10 @@ template <class ElementType, std::size_t Extent>
827811span<const gsl::impl::byte, details::calculate_byte_size<ElementType, Extent>::value>
828812as_bytes(span<ElementType, Extent> s) noexcept
829813{
830- using type = span<const gsl::impl::byte, details::calculate_byte_size<ElementType, Extent>::value>;
814+ using type =
815+ span<const gsl::impl::byte, details::calculate_byte_size<ElementType, Extent>::value>;
831816
832- // clang-format off
833- GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
834- // clang-format on
817+ GSL_SUPPRESS(type.1)
835818 return type{reinterpret_cast<const gsl::impl::byte*>(s.data()), s.size_bytes()};
836819}
837820
@@ -842,9 +825,7 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
842825{
843826 using type = span<gsl::impl::byte, details::calculate_byte_size<ElementType, Extent>::value>;
844827
845- // clang-format off
846- GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
847- // clang-format on
828+ GSL_SUPPRESS(type.1)
848829 return type{reinterpret_cast<gsl::impl::byte*>(s.data()), s.size_bytes()};
849830}
850831
0 commit comments