Fix SharedString::end() throwing an exception when MSVC iterator debugging is enabled (#4017)

Don't dereference end() of a string_view.

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
This commit is contained in:
Simon Hausmann 2023-11-27 18:11:55 +01:00 committed by GitHub
parent 6195fc8567
commit 42d575262e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View file

@ -39,6 +39,12 @@ SCENARIO("SharedString API")
REQUIRE(str == "Hello 🦊!");
REQUIRE(std::string_view(str.data()) == "Hello 🦊!");
}
SECTION("begin/end")
{
str = "Hello";
REQUIRE(str.begin() + std::string_view(str).size() == str.end());
}
}
TEST_CASE("Basic SharedVector API", "[vector]")