Don't use deprecated checked_array_iterator

This commit is contained in:
Victor Zverovich
2023-07-20 07:06:32 -07:00
parent 661b23edeb
commit 9bea6ec04a
3 changed files with 10 additions and 29 deletions

View File

@ -1674,8 +1674,7 @@ TEST(format_test, format_custom) {
TEST(format_test, format_to_custom) {
char buf[10] = {};
auto end =
&*fmt::format_to(fmt::detail::make_checked(buf, 10), "{}", Answer());
auto end = fmt::format_to(buf, "{}", Answer());
EXPECT_EQ(end, buf + 2);
EXPECT_STREQ(buf, "42");
}

View File

@ -167,10 +167,8 @@ struct scan_handler : error_handler {
void on_text(const char* begin, const char* end) {
auto size = to_unsigned(end - begin);
auto it = scan_ctx_.begin();
if (it + size > scan_ctx_.end() ||
!std::equal(begin, end, make_checked(it, size))) {
if (it + size > scan_ctx_.end() || !std::equal(begin, end, it))
on_error("invalid input");
}
scan_ctx_.advance_to(it + size);
}