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-
This commit is contained in:
MarcoFalke
2024-12-17 16:25:22 +01:00
parent fadccc26c0
commit fade0b5e5e
120 changed files with 543 additions and 543 deletions

View File

@@ -15,7 +15,7 @@ struct Ignore
template<typename T> Ignore(T&&) {}
};
template<typename T>
bool Spannable(T&& value, decltype(Span{value})* enable = nullptr)
bool Spannable(T&& value, decltype(std::span{value})* enable = nullptr)
{
return true;
}
@@ -42,9 +42,9 @@ using namespace spannable;
BOOST_AUTO_TEST_SUITE(span_tests)
// Make sure template Span template deduction guides accurately enable calls to
// Span constructor overloads that work, and disable calls to constructor overloads that
// don't work. This makes it is possible to use the Span constructor in a SFINAE
// Make sure template std::span template deduction guides accurately enable calls to
// std::span constructor overloads that work, and disable calls to constructor overloads that
// don't work. This makes it is possible to use the std::span constructor in a SFINAE
// contexts like in the Spannable function above to detect whether types are or
// aren't compatible with Spans at compile time.
BOOST_AUTO_TEST_CASE(span_constructor_sfinae)
@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE(span_constructor_sfinae)
BOOST_CHECK(!Spannable(std::set<int>{}));
BOOST_CHECK(!Spannable(std::vector<bool>{}));
BOOST_CHECK(Spannable(std::array<int, 3>{}));
BOOST_CHECK(Spannable(Span<int>{}));
BOOST_CHECK(Spannable(std::span<int>{}));
BOOST_CHECK(Spannable("char array"));
BOOST_CHECK(Spannable(SpannableYes{}));
BOOST_CHECK(!Spannable(SpannableNo{}));