[PR #4123] [MERGED] Introduce til::some #25648

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4123
Author: @miniksa
Created: 1/6/2020
Status: Merged
Merged: 1/9/2020
Merged by: @miniksa

Base: masterHead: dev/miniksa/some


📝 Commits (8)

  • 08bb898 draft of til::some
  • 4c2c186 Move some to its own file that imports array, fix up an issue related to how I was templatizing the iterators.
  • 3b07ffd Add test project, don't derive from std::array or use std:: namespace privates, make a til test library, make some tests for some.
  • 30d89bd codeformat pass.
  • 1c7910a Add initializer list. Finish adding tests.
  • 121d2d6 Add new test lib to test script helpers.
  • 9c82f33 Fix signed/unsigned mismatch making x86 unhappy. A few last tweaks to some.h based on PR comments.
  • da4350b Don't audit unit tests.

📊 Changes

15 files changed (+603 additions, -1 deletions)

View changed files

📝 OpenConsole.sln (+23 -0)
📝 src/dirs (+1 -0)
📝 src/inc/til.h (+2 -0)
src/inc/til/some.h (+184 -0)
src/til/dirs (+2 -0)
src/til/precomp.cpp (+4 -0)
src/til/precomp.h (+31 -0)
src/til/ut_til/DefaultResource.rc (+12 -0)
src/til/ut_til/SomeTests.cpp (+275 -0)
src/til/ut_til/product.pbxproj (+4 -0)
src/til/ut_til/sources (+33 -0)
src/til/ut_til/til.unit.tests.vcxproj (+29 -0)
📝 tools/OpenConsole.psm1 (+1 -1)
📝 tools/runut.cmd (+1 -0)
📝 tools/tests.xml (+1 -0)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4123 **Author:** [@miniksa](https://github.com/miniksa) **Created:** 1/6/2020 **Status:** ✅ Merged **Merged:** 1/9/2020 **Merged by:** [@miniksa](https://github.com/miniksa) **Base:** `master` ← **Head:** `dev/miniksa/some` --- ### 📝 Commits (8) - [`08bb898`](https://github.com/microsoft/terminal/commit/08bb8987a6655dec2d8d9c376779ac02e815dbd9) draft of til::some - [`4c2c186`](https://github.com/microsoft/terminal/commit/4c2c186daa0203456e0ae7d69b38b1ae3fa84502) Move some to its own file that imports array, fix up an issue related to how I was templatizing the iterators. - [`3b07ffd`](https://github.com/microsoft/terminal/commit/3b07ffdd9d55e4b309d8d232d06e97b9164f2118) Add test project, don't derive from std::array or use std:: namespace privates, make a til test library, make some tests for some. - [`30d89bd`](https://github.com/microsoft/terminal/commit/30d89bd6e4aa2feb7bd6172f89c95ffdd5c355bf) codeformat pass. - [`1c7910a`](https://github.com/microsoft/terminal/commit/1c7910a934254b5b540f46c2a32d8cc4e79f4a4e) Add initializer list. Finish adding tests. - [`121d2d6`](https://github.com/microsoft/terminal/commit/121d2d67dd0042e13a760bc8f94b7e9e0bb06df5) Add new test lib to test script helpers. - [`9c82f33`](https://github.com/microsoft/terminal/commit/9c82f336f0126d69c902f9c83f65f0728462cba2) Fix signed/unsigned mismatch making x86 unhappy. A few last tweaks to some.h based on PR comments. - [`da4350b`](https://github.com/microsoft/terminal/commit/da4350bdcd61cb19a45ba0797e68990db92064ed) Don't audit unit tests. ### 📊 Changes **15 files changed** (+603 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `OpenConsole.sln` (+23 -0) 📝 `src/dirs` (+1 -0) 📝 `src/inc/til.h` (+2 -0) ➕ `src/inc/til/some.h` (+184 -0) ➕ `src/til/dirs` (+2 -0) ➕ `src/til/precomp.cpp` (+4 -0) ➕ `src/til/precomp.h` (+31 -0) ➕ `src/til/ut_til/DefaultResource.rc` (+12 -0) ➕ `src/til/ut_til/SomeTests.cpp` (+275 -0) ➕ `src/til/ut_til/product.pbxproj` (+4 -0) ➕ `src/til/ut_til/sources` (+33 -0) ➕ `src/til/ut_til/til.unit.tests.vcxproj` (+29 -0) 📝 `tools/OpenConsole.psm1` (+1 -1) 📝 `tools/runut.cmd` (+1 -0) 📝 `tools/tests.xml` (+1 -0) </details> ### 📄 Description ## 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:10:52 +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#25648