Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>So, not only must the general specialization not conflict with the array specialization, it can't conflict with any specialization that names a user-defined type. That is, if the user declares a specialization, the existence of the general argument getter cannot affect whether it's chosen.</p> </blockquote> <p>I don't understand this. What do you mean?</p> <hr> <blockquote> <p>Is it OK for the implementation to expose a general template indexer through std::tuple_element?</p> </blockquote> <p>It's impossible to do so for the general case. Imagine this one</p> <pre><code>template&lt;int A, char B, long C, class D, int &amp;X, int(*Handler)()&gt; struct funny_template { }; int x, y(); std::tuple_element&lt;3, funny_template&lt;1, 2, 3, long, x, y&gt; &gt;::type along = 0; </code></pre> <p>Happy macro meta-programming :)</p> <hr> <blockquote> <p>I haven't made many forays into the partial ordering rules. Is this analysis correct?</p> </blockquote> <p>Partial ordering for two partial specializations</p> <pre><code>template&lt;class A1, ..., class AN&gt; class T&lt;Am1, ..., AmM&gt;; template&lt;class B1, ..., class BL&gt; class T&lt;Bm1, ..., BmM&gt;; </code></pre> <p>Works like transforming them to function templates and ordering <em>them</em></p> <pre><code>template&lt;class A1, ..., class AN&gt; void f(T1&lt;Am1, ..., AmM&gt;); template&lt;class B1, ..., class BL&gt; void f(T2&lt;Bm1, ..., BmM&gt;); </code></pre> <p>Partial ordering like your analysis says correctly puts unique types for each template parameter transforming it to an argument for argument deduction, comparing it to the other template</p> <pre><code>T1A&lt;Uam1, ..., UAmM&gt; -&gt; T2&lt;Bm1, ..., BmM&gt; T2A&lt;UBm1, ..., UBmM&gt; -&gt; T1&lt;Am1, ..., AmM&gt; </code></pre> <p>If there is a non-deduced context it's not compared like usual. Like if <code>BmM</code> is <code>typename Foo::X</code>, the first deduction above would consider deduction of the last sub-type as success because there can't be a mismatch for a nondeduced context. The other way around though, <code>Foo::X</code> against <code>AmM</code> <em>can</em> mismatch though if <code>AmM</code> is not a nondeduced context itself. </p> <p>If deduction succeeds for one round and not the other way around (... leaving off some other rules because they only happen for real function template ordering), the template on the right side above for the round that failed deduction is more specialized. Otherwise, the partial specializations are unordered. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload