From cb475cb8847be6b9ac359cf01305016313dc5964 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 25 Apr 2020 10:02:00 -0700 Subject: [PATCH] Clarify why we don't check argument id --- include/fmt/core.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/fmt/core.h b/include/fmt/core.h index 566da7e3..4dcf428b 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -594,6 +594,8 @@ class basic_format_parse_context : private ErrorHandler { the next argument index and switches to the automatic indexing. */ FMT_CONSTEXPR int next_arg_id() { + // Don't check if the argument id is valid to avoid overhead and because it + // will be checked during formatting anyway. if (next_arg_id_ >= 0) return next_arg_id_++; on_error("cannot switch from manual to automatic argument indexing"); return 0;