|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4449" status="New"> |
| 5 | +<title>`define_aggregate` members must be public</title> |
| 6 | +<section> |
| 7 | +<sref ref="[meta.reflection.define.aggregate]"/> |
| 8 | +</section> |
| 9 | +<submitter>Daniel Katz</submitter> |
| 10 | +<date>05 Nov 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +The access of members of classes defined by injected declarations produced by evaluations of |
| 16 | +`std::meta::define_aggregate` is unspecified. |
| 17 | +</p> |
| 18 | +</discussion> |
| 19 | + |
| 20 | +<resolution> |
| 21 | +<p> |
| 22 | +This wording is relative to <paper num="N5014"/>. |
| 23 | +</p> |
| 24 | + |
| 25 | +<ol> |
| 26 | + |
| 27 | +<li><p>Modify <sref ref="[meta.reflection.define.aggregate]"/> as indicated:</p> |
| 28 | + |
| 29 | +<blockquote> |
| 30 | +<pre> |
| 31 | +template<reflection_range R = initializer_list<info>> |
| 32 | + consteval info define_aggregate(info class_type, R&& mdescrs); |
| 33 | +</pre> |
| 34 | +<blockquote> |
| 35 | +<p> |
| 36 | +-7- Let <tt><i>C</i></tt> be the class represented by `class_type` and <tt><i>r<sub>K</sub></i></tt> |
| 37 | +be the <tt><i>K</i></tt><sup>th</sup> reflection value in `mdescrs`. […] |
| 38 | +<p/> |
| 39 | +-8- <i>Constant When</i>: […] |
| 40 | +<p/> |
| 41 | +-9- <i>Effects</i>: Produces an injected declaration <tt><i>D</i></tt> (<sref ref="[expr.const]"/>) |
| 42 | +that defines <tt><i>C</i></tt> and has properties as follows: |
| 43 | +</p> |
| 44 | +<ul style="list-style-type: none"> |
| 45 | +<li>(9.1) — […] |
| 46 | +</li> |
| 47 | +<li>(9.2) — […] |
| 48 | +</li> |
| 49 | +<li>(9.3) — […] |
| 50 | +</li> |
| 51 | +<li>(9.4) — […] |
| 52 | +</li> |
| 53 | +<li>(9.5) — For each <tt><i>r<sub>K</sub></i></tt>, there is a corresponding entity |
| 54 | +<tt><i>M<sub>K</sub></i></tt> <ins>with public access</ins> belonging to the class scope |
| 55 | +of <tt><i>D</i></tt> with the following properties: […] |
| 56 | +</li> |
| 57 | +<li>(9.6) — […] |
| 58 | +</li> |
| 59 | +</ul> |
| 60 | +</blockquote> |
| 61 | +</blockquote> |
| 62 | +</li> |
| 63 | +</ol> |
| 64 | + |
| 65 | +</resolution> |
| 66 | + |
| 67 | +</issue> |
0 commit comments