LWG-4293 `span::subspan`/`first`/`last` chooses wrong constructor when `T` is `const`-qualified `bool`
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
LWG-4293 span::subspan/first/last chooses wrong constructor when T is const-qualified bool
This LWG issue resolution (accepted at the 2025-11 meeting) has no functional effect after WG21-P2447R6 "Constructing span<const T> From initializer_list<T>" was reverted by WG21-P4144R1 "Remove span's initializer_list Constructor" at the 2026-03 meeting (see #4173).
However, we have a general principle of "Do What The Standard Says", which should be worth following here.
Contributor guide
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
Read the LWG-4293 resolution and the referenced #4173 issue first, then locate the span implementation and its tests. Determine the required behavior for const-qualified bool in subspan, first, and last despite the initializer_list constructor reversal. Done means the implementation follows the accepted standard wording and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100