microsoft / microsoft/STL

LWG-4293 `span::subspan`/`first`/`last` chooses wrong constructor when `T` is `const`-qualified `bool`

Open
#6,239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

LWG
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.