<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 8, 2021, 23:40 Tom Honermann &lt;<a href="mailto:tom@honermann.net">tom@honermann.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div>
    <div>On 12/5/21 2:26 PM, Jens Maurer wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>On 05/12/2021 01.04, Tom Honermann wrote:
</pre>
      <blockquote type="cite">
        <pre>On 12/4/21 6:05 AM, Jens Maurer wrote:
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre>If we impose a requirement for a code unit -&gt; code point decoder for the
literal encoding at compile-time, we should make such a facility generally
available instead of hiding it in the guts of the std::format parser.
</pre>
        </blockquote>
        <pre>I think JeanHeyd&#39;s work on P1629 <a href="https://wg21.link/p1629" target="_blank" rel="noreferrer">&lt;https://wg21.link/p1629&gt;</a> will fill this niche. It would be nice if the features he proposes in N2730 <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2730.htm" target="_blank" rel="noreferrer">&lt;http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2730.htm&gt;</a> were usable at compile-time as well, but that will likely have to await some kind of constexpr support in C.
</pre>
      </blockquote>
      <pre>Why?  We&#39;ve made functions constexpr that are inherited from C
before.</pre>
    </blockquote>
    <p>Sure, we have, and could do so again. In this case, there are
      behaviors that we would have to specify that should be decided in
      conjunction with WG14. For example, the N2730 &quot;mc&quot; and &quot;mwc&quot;
      function variants operate on the locale dependent execution
      encoding. We would have to specify what that means for
      compile-time evaluation. The obvious answer is, of course, that it
      means the ordinary/wide literal encoding. Since that encoding may
      differ from the run-time execution encoding, this presumably means
      defining a locale (or at least the <font face="monospace">LC_CTYPE</font>
      locale category) for use at compile-time. We would then have to
      tie the behavior to <font face="monospace">std::is_constant_evaluated()</font>
      (so that the separation of compile-time vs run-time is rigorously
      defined) for which there is presently no corresponding C facility.</p>
    <p>These are not necessarily simple functions that can be readily be
      inlined or made builtins. As we&#39;ve previously discussed, EBCDIC
      code pages do not all consistently encode <font face="monospace">&#39;{&#39;</font>
      and<font face="monospace"> &#39;}&#39;</font>. An ISO-2022 escape
      mechanism that allows switching character sets presumably would
      require the implementation to track shift state and have access to
      character set tables in order to recognize all encodings of these
      characters. Though, perhaps such an encoding is disallowed by <a href="http://eel.is/c++draft/lex.charset#6" target="_blank" rel="noreferrer">[lex.charset]p6</a>?
      It isn&#39;t clear to me how to apply that wording to shift-state
      encodings.<br></p></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Nothing precludes shift state literal encodings, see note in the same paragraph.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><p>
    </p>
    <p>Tom.<br>
    </p>
  </div>

</blockquote></div></div></div>

