From 8c56e7a0e06d5a00e9d976d9613d24f28d26766f Mon Sep 17 00:00:00 2001 From: Roberto Rossini <71787608+robomics@users.noreply.github.com> Date: Fri, 2 Jun 2023 23:08:13 +0200 Subject: [PATCH] Try to make starts_with compile with -std=c++11 --- include/fmt/core.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 73974a74..8064ccb5 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -679,11 +679,10 @@ template class basic_format_parse_context { * Checks whether the format string starts with the given prefix */ constexpr bool starts_with(iterator prefix) const noexcept { - auto first = begin(); - auto last = end(); + std::ptrdiff_t i = 0; bool mismatch_found = false; - while (first != last && *prefix != '\0') { - if (*prefix++ != *first++) { + while (begin() + i != end() && *prefix != '\0') { + if (*prefix++ != *(begin() + i++)) { mismatch_found = true; break; }