Skip to content

Commit

Permalink
Fix static_string.cpp compilation with MSVC standard library
Browse files Browse the repository at this point in the history
std::array's iterator is a pointer in libc++ and libstdc++ so
`const auto*` works fine. However the array iterator is not a
pointer on MSVC so compilation fails. Removing the asterisk still
results in a pointer type being used but causes a clang-tidy check
to fail so we have to disable that.
  • Loading branch information
ChrisThrasher committed Feb 15, 2024
1 parent d55da72 commit f2f9398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/static_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ TEST_CASE("rsl::StaticString") {
auto const string = "Hello, world!"s;
auto const static_string = rsl::StaticString<14>(string);
CHECK(static_string.begin() != static_string.end());
auto const* begin = static_string.begin();
auto begin = static_string.begin(); // NOLINT(readability-qualified-auto)
CHECK(*begin++ == 'H');
CHECK(*begin++ == 'e');
CHECK(*begin++ == 'l');
Expand Down

0 comments on commit f2f9398

Please sign in to comment.