[PR #4123] Introduce til::some #25653

Open
opened 2026-01-31 09:10:54 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/4123

State: closed
Merged: Yes


Summary of the Pull Request

Introduces a type that is basically an array (stack allocated, fixed size) that reports size based on how many elements are actually filled (from the front), iterates only the filled ones, and has some basic vector push/pop semantics.

PR Checklist

  • I work here
  • I work here
  • I work here
  • I'd love to roll this out to SomeViewports.... maybe in this commit or a follow on one.
  • We need a TIL tests library and I should test this there.

Detailed Description of the Pull Request / Additional comments

The original gist of this was used for SomeViewports which was a struct to hold between 0 and 4 viewports, based on how many were left after subtraction (since rectangle subtraction functions in Windows code simply fail for resultants that yield >=2 rectangle regions.)

I figured now that we're TIL-ifying useful common utility things that this would be best suited to a template because I'm certain there are other circumstances where we would like to iterate a partially filled array and want it to not auto-resize-up like a vector would.

Validation Steps Performed

  • TIL tests added
**Original Pull Request:** https://github.com/microsoft/terminal/pull/4123 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Introduces a type that is basically an array (stack allocated, fixed size) that reports size based on how many elements are actually filled (from the front), iterates only the filled ones, and has some basic vector push/pop semantics. ## PR Checklist * [x] I work here * [x] I work here * [x] I work here * [ ] I'd love to roll this out to SomeViewports.... maybe in this commit or a follow on one. * [x] We need a TIL tests library and I should test this there. ## Detailed Description of the Pull Request / Additional comments The original gist of this was used for `SomeViewports` which was a struct to hold between 0 and 4 viewports, based on how many were left after subtraction (since rectangle subtraction functions in Windows code simply fail for resultants that yield >=2 rectangle regions.) I figured now that we're TIL-ifying useful common utility things that this would be best suited to a template because I'm certain there are other circumstances where we would like to iterate a partially filled array and want it to not auto-resize-up like a vector would. ## Validation Steps Performed * [x] TIL tests added
claunia added the pull-request label 2026-01-31 09:10:54 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25653