[dcl.init.aggr] The meaning of "corresponding" is vague in aggregate initialization
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
Since in c++17 standard, we introduce the aggregate initialization with the following sentence
When an aggregate is initialized by an initializer list as specified in [dcl.init.list], the elements of the initializer list are taken as initializers for the elements of the aggregate, in order.
"In order" hints that each element is initialized with the subsequent element of the initializer list. "In order" is instead with "corresponding" in the current draft, such as
Otherwise, the element is copy-initialized from the corresponding initializer-clause or is initialized with the brace-or-equal-initializer of the corresponding designated-initializer-clause.
I would argue that the use of either "in order" or "corresponding" is a bit vague in the definitions of the aggregate initialization. We should give that definition a more formal approach? For instance
Otherwise, the nth element is copy-initialized from the
correspondingnth initializer-clause or is initialized with the brace-or-equal-initializer of thecorrespondingnth designated-initializer-clause.
Which can coordinate with [dcl.init.aggr] p3.2
If the initializer list is a brace-enclosed initializer-list, the explicitly initialized elements of the aggregate are the first n elements of the aggregate, where n is the number of elements in the initializer list.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with [dcl.init.aggr] p3.2 and the paragraph using “corresponding” in the aggregate-initialization wording. Compare their treatment of initializer-list elements and designated initializers, then clarify whether the wording should formally identify the nth element and its initializer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100