|
| 1 | +<HTML> |
| 2 | +<HEAD> |
| 3 | +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 4 | +<TITLE> |
| 5 | + PR 6804</TITLE> |
| 6 | +<STYLE TYPE="text/css"> |
| 7 | + INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 } |
| 8 | + .INS { text-decoration:none; background-color:#D0FFD0 } |
| 9 | + DEL { text-decoration:line-through; background-color:#FFA0A0 } |
| 10 | + .DEL { text-decoration:line-through; background-color: #FFD0D0 } |
| 11 | + SPAN.cmnt { font-family:Times; font-style:italic } |
| 12 | +</STYLE> |
| 13 | +</HEAD> |
| 14 | +<H4>PR 6804. |
| 15 | + |
| 16 | + Clean up wording for template template argument matching |
| 17 | +</H4> |
| 18 | +<B>Section: </B>13.4.4 [<A href="https://wg21.link/temp.arg.template">temp.arg.template</A>] |
| 19 | + |
| 20 | + |
| 21 | + <B>Status: </B>pull request |
| 22 | + |
| 23 | + |
| 24 | + <B>Submitter: </B>James Touton |
| 25 | + |
| 26 | + |
| 27 | + <B>Date: </B>2024-02-12<BR> |
| 28 | + |
| 29 | +<BLOCKQUOTE> |
| 30 | +<B>James Touton: </B>I've rearranged the paragraphs describing matching in terms of partial ordering vs component-wise matching to more clearly separate the concepts. I've also cleaned up some resulting redundant wording and moved the examples into separate paragraphs as they're fairly general within the context of this section (with the exception of the last example, which could reasonably be pulled into the paragraph on matching in terms of partial ordering). |
| 31 | +</BLOCKQUOTE> |
| 32 | + |
| 33 | +<BLOCKQUOTE> |
| 34 | +<B>Thomas Köppe: </B>@jensmaurer A Core perspective would be welcome here. I think we've asked James to send us this? |
| 35 | +</BLOCKQUOTE> |
| 36 | + |
| 37 | +<BLOCKQUOTE> |
| 38 | +<B>Jens Maurer: </B>I don't remember. It needs careful before-after comparison. |
| 39 | +</BLOCKQUOTE> |
| 40 | + |
| 41 | +<BLOCKQUOTE> |
| 42 | +<B>James touton: </B>I sent this unprompted; Core has not seen this. |
| 43 | +</BLOCKQUOTE> |
| 44 | + |
| 45 | +<P><B>Proposed resolution:</B></P> |
| 46 | + |
| 47 | +<P> |
| 48 | +The text from paragraph 3 containing the phrase "at least as specialized" will be relocated to paragraph 4, where the meaning of that phrase is actually described. |
| 49 | +Paragraphs 3 and 4 will be swapped so that the "at least as specialized" wording precedes the older "matches" wording. |
| 50 | +The examples from paragraph 3 will be relocated, each into its own paragraph at the end of the section. |
| 51 | +</P> |
| 52 | + |
| 53 | +<P>Change in 13.4.4 [<A href="https://wg21.link/temp.arg.template#4">temp.arg.template</A>] paragraph 4 as follows:</P> |
| 54 | + |
| 55 | +<BLOCKQUOTE> |
| 56 | +<P> |
| 57 | + A template <INS><I>template-argument</I> <CODE>A</CODE> matches a template</INS> |
| 58 | + <I>template-parameter</I> <CODE>P</CODE> <INS>when <CODE>P</CODE></INS> |
| 59 | + is at least as specialized as <DEL>a template <I>template-argument</I></DEL> <CODE>A</CODE><INS>, |
| 60 | + ignoring constraints on <CODE>A</CODE> if <CODE>P</CODE> is unconstrained. |
| 61 | + <CODE>P</CODE> is at least as specialized as <CODE>A</CODE></INS> |
| 62 | + if, given the following rewrite to two function templates, |
| 63 | + ... |
| 64 | +</P> |
| 65 | +</BLOCKQUOTE> |
| 66 | + |
| 67 | +<P>Change in 13.4.4 [<A href="https://wg21.link/temp.arg.template#3">temp.arg.template</A>] paragraph 3 as follows:</P> |
| 68 | + |
| 69 | +<BLOCKQUOTE> |
| 70 | +<P> |
| 71 | + <DEL>A <I>template-argument</I> matches a template |
| 72 | + <I>template-parameter</I> <CODE>P</CODE> when |
| 73 | + <CODE>P</CODE> is at least as specialized as the <I>template-argument</I> <CODE>A</CODE>. |
| 74 | + In this comparison, if <CODE>P</CODE> is unconstrained, |
| 75 | + the constraints on <CODE>A</CODE> are not considered.</DEL> |
| 76 | + If <CODE>P</CODE> contains a template parameter pack<INS> (13.7.4 [<A href="https://wg21.link/temp.variadic">temp.variadic</A>])</INS>, then |
| 77 | + <CODE>A</CODE> also matches <CODE>P</CODE> |
| 78 | + if each of <CODE>A</CODE>'s template parameters |
| 79 | + matches the corresponding template parameter in the |
| 80 | + <I>template-head</I> of <CODE>P</CODE>. |
| 81 | + Two template parameters match if they are of the same kind (type, non-type, template), |
| 82 | + for non-type <I>template-parameter</I>s, their types are |
| 83 | + equivalent (13.7.7.2 [<A href="https://wg21.link/temp.over.link">temp.over.link</A>]), and for template <I>template-parameter</I>s, |
| 84 | + each of their corresponding <I>template-parameter</I>s matches, recursively. |
| 85 | + <DEL>When <CODE>P</CODE>'s <I>template-head</I> contains a template parameter |
| 86 | + pack (13.7.4 [<A href="https://wg21.link/temp.variadic">temp.variadic</A>]), the template parameter pack</DEL> |
| 87 | + <INS>A template parameter pack in the <I>template-head</I> of <CODE>P</CODE></INS> |
| 88 | + will match zero or more template parameters or template parameter packs in the <I>template-head</I> of |
| 89 | + <CODE>A</CODE> with the same type and form as the template parameter pack in <CODE>P</CODE> |
| 90 | + (ignoring whether those template parameters are template parameter packs). |
| 91 | +</P> |
| 92 | + |
| 93 | +<P><DEL>[ <I>Example</I>: ... <I>end example</I> ]</DEL></P> |
| 94 | +<P><DEL>[ <I>Example</I>: ... <I>end example</I> ]</DEL></P> |
| 95 | +<P><DEL>[ <I>Example</I>: ... <I>end example</I> ]</DEL></P> |
| 96 | +</BLOCKQUOTE> |
| 97 | + |
| 98 | +<P>Swap the order of paragraphs 3 and 4.</P> |
| 99 | + |
| 100 | +<P>Add each deleted example from paragraph 3 as a new paragraph at the end of the section.</P> |
| 101 | + |
| 102 | +<BR><BR> |
| 103 | +</BODY> |
| 104 | +</HTML> |
0 commit comments