Skip to content

Commit

Permalink
Daniel provides improved P/R
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani-Hub committed Sep 23, 2023
1 parent 6b25038 commit 6c6679b
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion xml/issue3975.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,53 @@ would need to have (e.g., it does not provide a means to initialize the expositi
library was not designed to be able to work with user specializations of <tt>std::basic_format_context</tt>, declaring
such specializations should be explicitly disallowed.
</p>

<superseded>
<p>
This wording is relative to <paper num="N4958"/>.
</p>

<ol>

<li><p>Modify the <sref ref="[format.context]"/> as indicated:</p>

<blockquote>
<p>
-1- An instance of <tt>basic_format_context</tt> holds formatting state consisting of the formatting arguments and
the output iterator.
<p/>
<ins>-?- The behavior of a program that adds specializations of <tt>basic_format_context</tt> is undefined.</ins>
<p/>
-2- <tt>Out</tt> shall model <tt>output_iterator&lt;const charT&amp;&gt;</tt>.
</p>
</blockquote>

</li>
</ol>
</superseded>

<note>2023-09-23; Daniel comments and provides improved wording</note>
<p>
During the reflector discussion, Dietmar pointed out that the constraint can in principle be checked statically (e.g. when the
Library creates or refers to an instantiation of <tt>basic_format_context</tt>), so we can reduce the rather draconian consequence of
"undefined behaviour" to "ill-formed, no diagnostics required". Furthermore, the new wording also adds the same constraint to
<tt>basic_format_parse_context</tt> as suggested by Tim. This is needed, since only one public constructor is specified, but
that specification does not allow to construct an object a non-zero <tt>num_args_</tt> or with the type information necessary
for the <tt>check_dynamic_spec*</tt> functions, so the library has an unspecified way to realize this.
</p>
</discussion>

<resolution>
<p>
This wording is relative to <paper num="N4958"/>.
</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> The suggested wording form is borrowed from exactly the same wording form used for <tt>allocator_traits</tt>.]
</p>
</blockquote>

<ol>

<li><p>Modify the <sref ref="[format.context]"/> as indicated:</p>
Expand All @@ -33,12 +73,27 @@ This wording is relative to <paper num="N4958"/>.
-1- An instance of <tt>basic_format_context</tt> holds formatting state consisting of the formatting arguments and
the output iterator.
<p/>
<ins>-?- The behavior of a program that adds specializations of <tt>basic_format_context</tt> is undefined.</ins>
<ins>-?- If a program declares an explicit or partial specialization of <tt>basic_format_context</tt>, the program is ill-formed,
no diagnostic required.</ins>
<p/>
-2- <tt>Out</tt> shall model <tt>output_iterator&lt;const charT&amp;&gt;</tt>.
</p>
</blockquote>

</li>

<li><p>Modify the <sref ref="[format.parse.ctx]"/> as indicated:</p>

<blockquote>
<p>
-1- An instance of <tt>basic_format_parse_context</tt> holds the format string parsing state consisting of the format
string range being parsed and the argument counter for automatic indexing.
<p/>
<ins>-?- If a program declares an explicit or partial specialization of <tt>basic_format_parse_context</tt>, the program is ill-formed,
no diagnostic required.</ins>
</p>
</blockquote>

</li>
</ol>
</resolution>
Expand Down

0 comments on commit 6c6679b

Please sign in to comment.