Commit Graph

5 Commits

Author SHA1 Message Date
MarcoFalke
fade0b5e5e
scripted-diff: Use std::span over Span
-BEGIN VERIFY SCRIPT-

 ren() { sed -i "s!\<$1\>!$2!g" $( git grep -l "$1" -- "./src" ":(exclude)src/span.h" ":(exclude)src/leveldb/db/log_test.cc" ) ; }

 ren Span            std::span
 ren AsBytes         std::as_bytes
 ren AsWritableBytes std::as_writable_bytes

 sed -i 's!SpanPopBack(Span!SpanPopBack(std::span!g' ./src/span.h

-END VERIFY SCRIPT-
2025-03-12 19:45:37 +01:00
MarcoFalke
fadccc26c0
refactor: Make Span an alias of std::span
This uses a macro, which can be a bit more brittle than an alias
template. However, class template argument deduction for alias templates
is only implemented in clang-19.
2025-03-12 19:44:40 +01:00
MarcoFalke
fa27e36717
test: Fix broken span_tests
* The comment is wrong claiming that void* was returned when void was
  returned in reality.
* The namespace is missing a name, leading to compile errors that are
  suppressed with non-standard pragmas, and leading to compile errors in
  future commits. Instead of using more non-standard suppressions, just
  add the missing name.
* The SpanableYes/No types are missing begin/end iterators, which will
  be needed when using std::span.
2025-03-12 19:44:30 +01:00
Lőrinc
b03b20685a Fix CI-detected codespell warnings 2024-02-23 23:01:07 +01:00
Ryan Ofsky
6d43aad742 span: Make Span template deduction guides work in SFINAE context
Also add test to make sure this doesn't get broken in the future.

This was breaking vector<bool> serialization in multiprocess code because
template current deduction guides would make it appear like vector<bool> could
be converted to a span, but then the actual conversion to span would fail.
2023-10-20 10:30:16 -04:00