From 864465419079791bf61bcf51e633cab6e6be71bb Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Jun 2022 21:38:15 +0700 Subject: [PATCH] Docs: add comment about empty format context range --- doc/api.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api.rst b/doc/api.rst index acc7fa4c..02aa994d 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -209,6 +209,10 @@ template and implement ``parse`` and ``format`` methods:: // parse specifiers until '}' or the end of the range. In this example // the formatter should parse the 'f' specifier and return an iterator // pointing to '}'. + + // Please also note that this character range may be empty, in case of + // the "{}" format string, so therefore you should check ctx.begin() + // for equality with ctx.end(). // Parse the presentation format and store it in the formatter: auto it = ctx.begin(), end = ctx.end();