Skip to content

Commit

Permalink
Rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
brevzin committed Feb 15, 2024
1 parent ee171ce commit 2775e2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 2996_reflection/p2996r2.html
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,7 @@ <h3 data-number="4.4.8" id="template_of-template_arguments_of"><span class="head
<span id="cb56-3"><a href="#cb56-3"></a> <span class="kw">consteval</span> <span class="kw">auto</span> template_arguments_of<span class="op">(</span>info r<span class="op">)</span> <span class="op">-&gt;</span> vector<span class="op">&lt;</span>info<span class="op">&gt;</span>;</span>
<span id="cb56-4"><a href="#cb56-4"></a><span class="op">}</span></span></code></pre></div>
</blockquote>
<p>If <code class="sourceCode cpp">r</code> is a reflection designated a type that is a specialization of some template, then <code class="sourceCode cpp">template_of<span class="op">(</span>r<span class="op">)</span></code> is a reflection of that template and <code class="sourceCode cpp">template_arguments_of<span class="op">(</span>r<span class="op">)</span></code> is a vector of the reflections of the template arguments. In other words, the preconditions on both is that <code class="sourceCode cpp">has_template_arguments<span class="op">(</span>r<span class="op">)</span></code> is <code class="sourceCode cpp"><span class="kw">true</span></code>.</p>
<p>If <code class="sourceCode cpp">r</code> is a reflection designated a specialization of some template, then <code class="sourceCode cpp">template_of<span class="op">(</span>r<span class="op">)</span></code> is a reflection of that template and <code class="sourceCode cpp">template_arguments_of<span class="op">(</span>r<span class="op">)</span></code> is a vector of the reflections of the template arguments. In other words, the preconditions on both is that <code class="sourceCode cpp">has_template_arguments<span class="op">(</span>r<span class="op">)</span></code> is <code class="sourceCode cpp"><span class="kw">true</span></code>.</p>
<p>For example:</p>
<blockquote>
<div class="sourceCode" id="cb57"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb57-1"><a href="#cb57-1"></a>std<span class="op">::</span>vector<span class="op">&lt;</span><span class="dt">int</span><span class="op">&gt;</span> v <span class="op">=</span> <span class="op">{</span><span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">3</span><span class="op">}</span>;</span>
Expand Down Expand Up @@ -2805,7 +2805,7 @@ <h3 data-number="5.2.4" id="meta.reflection.queries-reflection-queries"><span cl
<div class="sourceCode" id="cb112"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb112-1"><a href="#cb112-1"></a><span class="kw">consteval</span> info template_of<span class="op">(</span>info r<span class="op">)</span>;</span>
<span id="cb112-2"><a href="#cb112-2"></a><span class="kw">consteval</span> vector<span class="op">&lt;</span>info<span class="op">&gt;</span> template_arguments_of<span class="op">(</span>info r<span class="op">)</span>;</span></code></pre></div>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_91" id="pnum_91">28</a></span> <em>Mandates</em>: <code class="sourceCode cpp">has_template_arguments<span class="op">(</span>r<span class="op">)</span></code> is <code class="sourceCode cpp"><span class="kw">true</span></code>.</p>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_92" id="pnum_92">29</a></span> <em>Returns</em>: A reflection of the template of <code class="sourceCode cpp">r</code>, and the reflections of the template arguments of, the specialization designated by <code class="sourceCode cpp">r</code>, respectively.</p>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_92" id="pnum_92">29</a></span> <em>Returns</em>: A reflection of the template of <code class="sourceCode cpp">r</code>, and the reflections of the template arguments of the specialization designated by <code class="sourceCode cpp">r</code>, respectively.</p>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_93" id="pnum_93">30</a></span> [<em>Example</em>:</p>
<div class="sourceCode" id="cb113"><pre class="sourceCode default"><code class="sourceCode default"><span id="cb113-1"><a href="#cb113-1"></a>template &lt;class T, class U=T&gt; struct Pair { };</span>
<span id="cb113-2"><a href="#cb113-2"></a>template &lt;class T&gt; using PairPtr = Pair&lt;T*&gt;;</span>
Expand Down

0 comments on commit 2775e2b

Please sign in to comment.