AK: Conform SimpleIterator to the random access iterator requirements

This requires pulling in some of the STL, but the result is that our
iterator is now STL Approved ™️ and our containers can be
auto-conformed to Swift protocols.
This commit is contained in:
Andrew Kaster
2024-08-05 23:45:36 -06:00
committed by Andrew Kaster
parent 227ac9973f
commit 756ef2c722
6 changed files with 109 additions and 26 deletions

View File

@@ -40,6 +40,11 @@ TEST_CASE(compare_views)
EXPECT_EQ(view1, "foo");
}
TEST_CASE(conforms_to_iterator_protocol)
{
static_assert(std::random_access_iterator<StringView::ConstIterator>);
}
TEST_CASE(string_view_literal_operator)
{
StringView literal_view = "foo"sv;