Skip to content

Commit

Permalink
Address a few nits called out by Vlad. (#202)
Browse files Browse the repository at this point in the history
Co-authored-by: dkatz85 <[email protected]>
  • Loading branch information
katzdm and dkatz85 authored Nov 5, 2024
1 parent 7d297e7 commit 187f142
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
34 changes: 14 additions & 20 deletions 2996_reflection/p2996r8.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="mpark/wg21" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="dcterms.date" content="2024-11-04" />
<meta name="dcterms.date" content="2024-11-05" />
<title>Reflection for C++26</title>
<style>
code{white-space: pre-wrap;}
Expand Down Expand Up @@ -565,7 +565,7 @@ <h1 class="title" style="text-align:center">Reflection for C++26</h1>
</tr>
<tr>
<td>Date:</td>
<td>2024-11-04</td>
<td>2024-11-05</td>
</tr>
<tr>
<td style="vertical-align:top">Project:</td>
Expand Down Expand Up @@ -772,9 +772,9 @@ <h1 id="toctitle">Contents</h1>
expressions<span></span></a></li>
<li><a href="#expr.prim.id.splice-splice-specifiers" id="toc-expr.prim.id.splice-splice-specifiers">7.5.4.0*
[expr.prim.id.splice] Splice specifiers<span></span></a></li>
<li><a href="#expr.prim.id.general-general" id="toc-expr.prim.id.general-general"><span>7.5.5.1
<li><a href="#expr.prim.id.general-general" id="toc-expr.prim.id.general-general"><span>7.5.4.1
<span>[expr.prim.id.general]</span></span> General<span></span></a></li>
<li><a href="#expr.prim.id.qual-qualified-names" id="toc-expr.prim.id.qual-qualified-names"><span>7.5.5.3
<li><a href="#expr.prim.id.qual-qualified-names" id="toc-expr.prim.id.qual-qualified-names"><span>7.5.4.3
<span>[expr.prim.id.qual]</span></span> Qualified
names<span></span></a></li>
<li><a href="#expr.prim.splice-expression-splicing" id="toc-expr.prim.splice-expression-splicing">7.5.8* [expr.prim.splice]
Expand Down Expand Up @@ -1013,7 +1013,7 @@ <h1 data-number="1" style="border-bottom:1px solid #cccccc" id="revision-history
<code class="sourceCode cpp">has_complete_definition</code>.</li>
<li>removed <code class="sourceCode cpp">subobjects_of</code> and
<code class="sourceCode cpp">accessible_subobjects_of</code> (will be
reintroduced by <span class="citation" data-cites="P3293R1">[<a href="https://wg21.link/p3293r1" role="doc-biblioref">P3293R1</a>]</span>).</li>
reintroduced by <span class="citation" data-cites="P3293R1">[<a href="#ref-P3293R1" role="doc-biblioref"><strong>P3293R1?</strong></a>]</span>).</li>
<li>specified constraints for
<code class="sourceCode cpp">enumerators_of</code> in terms of
<code class="sourceCode cpp">has_complete_definition</code>.</li>
Expand Down Expand Up @@ -1932,7 +1932,7 @@ <h2 data-number="3.9" id="a-simple-variant-type"><span class="header-section-num
</blockquote>
</div>
<p>Arguably, the answer should be yes - this would be consistent with
how other accesses work. This is instead proposed in <span class="citation" data-cites="P3293R1">[<a href="https://wg21.link/p3293r1" role="doc-biblioref">P3293R1</a>]</span>.</p>
how other accesses work. This is instead proposed in <span class="citation" data-cites="P3293R1">[<a href="#ref-P3293R1" role="doc-biblioref"><strong>P3293R1?</strong></a>]</span>.</p>
<p>On Compiler Explorer: <a href="https://godbolt.org/z/Efz5vsjaa">EDG</a>, <a href="https://godbolt.org/z/3bvo97fqf">Clang</a>.</p>
<h2 data-number="3.10" id="struct-to-struct-of-arrays"><span class="header-section-number">3.10</span> Struct to Struct of Arrays<a href="#struct-to-struct-of-arrays" class="self-link"></a></h2>
<div class="std">
Expand Down Expand Up @@ -5262,10 +5262,10 @@ <h3 class="unnumbered" id="expr.prim.id.splice-splice-specifiers">7.5.4.0*
</div>
</blockquote>
</div>
<h3 class="unnumbered" id="expr.prim.id.general-general"><span>7.5.5.1
<h3 class="unnumbered" id="expr.prim.id.general-general"><span>7.5.4.1
<a href="https://wg21.link/expr.prim.id.general">[expr.prim.id.general]</a></span>
General<a href="#expr.prim.id.general-general" class="self-link"></a></h3>
<p>Add a carve-out for reflection in <span>7.5.5.1 <a href="https://wg21.link/expr.prim.id.general">[expr.prim.id.general]</a></span>/4:</p>
<p>Add a carve-out for reflection in <span>7.5.4.1 <a href="https://wg21.link/expr.prim.id.general">[expr.prim.id.general]</a></span>/4:</p>
<div class="std">
<blockquote>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_37" id="pnum_37">4</a></span>
Expand Down Expand Up @@ -5293,7 +5293,7 @@ <h3 class="unnumbered" id="expr.prim.id.general-general"><span>7.5.5.1
</ul>
</blockquote>
</div>
<h3 class="unnumbered" id="expr.prim.id.qual-qualified-names"><span>7.5.5.3 <a href="https://wg21.link/expr.prim.id.qual">[expr.prim.id.qual]</a></span>
<h3 class="unnumbered" id="expr.prim.id.qual-qualified-names"><span>7.5.4.3 <a href="https://wg21.link/expr.prim.id.qual">[expr.prim.id.qual]</a></span>
Qualified names<a href="#expr.prim.id.qual-qualified-names" class="self-link"></a></h3>
<p>Add a production to the grammar for
<code class="sourceCode cpp"><em>nested-name-specifier</em></code> as
Expand Down Expand Up @@ -5390,7 +5390,7 @@ <h3 class="unnumbered" id="expr.prim.id.qual-qualified-names"><span>7.5.5.3 <a h
<h3 class="unnumbered" id="expr.prim.splice-expression-splicing">7.5.8*
[expr.prim.splice] Expression splicing<a href="#expr.prim.splice-expression-splicing" class="self-link"></a></h3>
<p>Add a new subsection of <span>7.5 <a href="https://wg21.link/expr.prim">[expr.prim]</a></span> following
<span>7.5.8 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span></p>
<span>7.5.7 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span></p>
<div class="std">
<blockquote>
<div class="addu">
Expand Down Expand Up @@ -5912,7 +5912,7 @@ <h3 class="unnumbered" id="expr.const-constant-expressions"><span>7.7 <a href="h
<a href="https://wg21.link/temp.names">[temp.names]</a></span>), or</li>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_97" id="pnum_97">(20.3)</a></span>
in a <code class="sourceCode cpp"><em>requires-expression</em></code>
(<span>7.5.8 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span>).</li>
(<span>7.5.7 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span>).</li>
</ul>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_98" id="pnum_98">21</a></span>
An expression or conversion is <em>plainly constant-evaluated</em> if it
Expand Down Expand Up @@ -7854,7 +7854,7 @@ <h3 class="unnumbered" id="meta.reflection.queries-reflection-queries">[meta.ref
<em>Returns</em>:
<code class="sourceCode cpp"><span class="kw">true</span></code> if
<code class="sourceCode cpp">r</code> represents a function that is
defined as deleted ([dcl.fct.def.delete])or defined as defaulted
defined as deleted ([dcl.fct.def.delete]) or defined as defaulted
([dcl.fct.def.default]), respectively. Otherwise,
<code class="sourceCode cpp"><span class="kw">false</span></code>.</p>
<div class="sourceCode" id="cb146"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb146-1"><a href="#cb146-1" aria-hidden="true" tabindex="-1"></a><span class="kw">consteval</span> <span class="dt">bool</span> is_user_provided<span class="op">(</span>info r<span class="op">)</span>;</span>
Expand Down Expand Up @@ -8290,10 +8290,8 @@ <h3 class="unnumbered" id="meta.reflection.member.queries-reflection-member-quer
<li>a function whose constraints (if any) are satisfied,</li>
<li>a non-static data member,</li>
<li>a namespace, or</li>
<li>a namespace alias,</li>
<li>a namespace alias.</li>
</ul>
<p>and if its first declaration is within a definition of
<code class="sourceCode cpp"><em>E</em></code>.</p>
<p><span class="note"><span>[ <em>Note 1:</em> </span>Counterexamples of
representable members include: injected class names, partial template
specializations, friend declarations, and static assertions.<span>
Expand Down Expand Up @@ -8480,7 +8478,7 @@ <h3 class="unnumbered" id="meta.reflection.layout-reflection-layout-queries">[me
<code class="sourceCode cpp"><em>T</em></code> is not incomplete.</p>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_296" id="pnum_296">6</a></span>
<em>Returns</em>: If <code class="sourceCode cpp">r</code> represents a
non-static data member whose associated subobject has type
non-static data member whose corresponding subobject has type
<code class="sourceCode cpp"><em>T</em></code>, or a description of a
declaration of such a data member, then <code class="sourceCode cpp"><span class="kw">sizeof</span><span class="op">(</span><em>T</em><span class="op">)</span></code>.
Otherwise, if <code class="sourceCode cpp">r</code> represents a type
Expand Down Expand Up @@ -9671,10 +9669,6 @@ <h1 data-number="6" style="border-bottom:1px solid #cccccc" id="bibliography"><s
[P3096R1] Adam Lach, Walter Genovese. 2024-05-15. Function Parameter
Reflection in Reflection for C++26. <a href="https://wg21.link/p3096r1"><div class="csl-block">https://wg21.link/p3096r1</div></a>
</div>
<div id="ref-P3293R1" class="csl-entry" role="doc-biblioentry">
[P3293R1] Barry Revzin, Peter Dimov, Dan Katz, Daveed Vandevoorde.
2024-10-13. Splicing a base class subobject. <a href="https://wg21.link/p3293r1"><div class="csl-block">https://wg21.link/p3293r1</div></a>
</div>
<div id="ref-P3295R0" class="csl-entry" role="doc-biblioentry">
[P3295R0] Ben Craig. 2024-05-21. Freestanding constexpr containers and
constexpr exception types. <a href="https://wg21.link/p3295r0"><div class="csl-block">https://wg21.link/p3295r0</div></a>
Expand Down
8 changes: 3 additions & 5 deletions 2996_reflection/reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -4736,7 +4736,7 @@ consteval bool is_deleted(info r);
consteval bool is_defaulted(info r);
```

[#]{.pnum} *Returns*: `true` if `r` represents a function that is defined as deleted ([dcl.fct.def.delete])or defined as defaulted ([dcl.fct.def.default]), respectively. Otherwise, `false`.
[#]{.pnum} *Returns*: `true` if `r` represents a function that is defined as deleted ([dcl.fct.def.delete]) or defined as defaulted ([dcl.fct.def.default]), respectively. Otherwise, `false`.

```cpp
consteval bool is_user_provided(info r);
Expand Down Expand Up @@ -5057,9 +5057,7 @@ consteval vector<info> members_of(info r);
* a function whose constraints (if any) are satisfied,
* a non-static data member,
* a namespace, or
* a namespace alias,

and if its first declaration is within a definition of `$E$`.
* a namespace alias.

[Counterexamples of representable members include: injected class names, partial template specializations, friend declarations, and static assertions.]{.note}

Expand Down Expand Up @@ -5182,7 +5180,7 @@ consteval size_t size_of(info r);

[#]{.pnum} *Constant When*: `r` is a reflection of a type, object, value, variable of non-reference type, non-static data member, base class specifier, or description of a declaration of a non-static data member. If `r` represents a type `$T$`, there is a point within the evaluation context from which `$T$` is not incomplete.

[#]{.pnum} *Returns*: If `r` represents a non-static data member whose associated subobject has type `$T$`, or a description of a declaration of such a data member, then `sizeof($T$)`. Otherwise, if `r` represents a type `T`, then `sizeof(T)`. Otherwise, `size_of(type_of(r))`.
[#]{.pnum} *Returns*: If `r` represents a non-static data member whose corresponding subobject has type `$T$`, or a description of a declaration of such a data member, then `sizeof($T$)`. Otherwise, if `r` represents a type `T`, then `sizeof(T)`. Otherwise, `size_of(type_of(r))`.

[The subobject corresponding to a non-static data member of reference type has the same size and alignment as the corresponding pointer type.]{.note}

Expand Down

0 comments on commit 187f142

Please sign in to comment.