Skip to content

[std.range.chooseAmong] Improve docs#10934

Merged
thewilsonator merged 1 commit intodlang:masterfrom
ntrel:choose-among-ex
Jan 23, 2026
Merged

[std.range.chooseAmong] Improve docs#10934
thewilsonator merged 1 commit intodlang:masterfrom
ntrel:choose-among-ex

Conversation

@ntrel
Copy link
Contributor

@ntrel ntrel commented Jan 23, 2026

Also add assert message when index > Ranges.length.

Remove sentence about 'only one range' - 2 are required.

Improve examples:

  • Use scope arrays instead of sliced static arrays for @nogc to halve number of declarations.
  • Add comments.
  • Merge 2 very similar scopes.
  • Split out minimum capabilities examples into separate unittest, because it's not easy to follow the array element values after mutations.

Also add assert message when `index > Ranges.length`.

Remove sentence about 'only one range' - 2 are required.
Improve examples:
Use scope arrays instead of sliced static arrays for `@nogc` to halve
number of declarations.
Add comments.
Merge 2 very similar scopes.
Split out minimum capabilities examples into separate unittest, because
it's not easy to follow the array element values after mutations.
@ntrel ntrel requested a review from PetarKirov as a code owner January 23, 2026 13:06
@thewilsonator thewilsonator merged commit 8566cc7 into dlang:master Jan 23, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants