Generate the TNumber OO TBox arrays - #80
Merged
estebanzimanyi merged 1 commit intoJul 23, 2026
Merged
Conversation
The number-box array accessors tboxes, splitNTboxes and splitEachNTboxes return a contiguous TBox array with a count out-parameter — the same fold shape as the span array, but TBox nests two Span structs, so its stride was beyond the scalar-only struct sizing. Resolve a struct field's size and alignment recursively, so a nested struct (a TBox's two Spans) contributes its own laid-out size, and add the TBox array fold: each element is copied off the array at the TBox stride and wrapped through the hand type. GeneratedTNumber now emits 16 methods; only the value-span returns (toSpan, valuespans) wait for the concrete numeric subclasses. A parity test checks the folded TBox lists against the raw arrays the wrappers fill.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The number-box array accessors
tboxes,splitNTboxesandsplitEachNTboxeseach return a contiguousTBoxarray with a count out-parameter — the same fold shape as the span array.TBoxnests twoSpanstructs, so its stride is beyond the scalar-only struct sizing.This resolves a struct field's size and alignment recursively, so a nested struct (a
TBox's twoSpans) contributes its own laid-out size, and adds theTBoxarray fold: each element is copied off the array at theTBoxstride and wrapped through the hand type.GeneratedTNumberemits 16 methods; only the value-span returns (toSpan,valuespans) wait for the concrete numeric subclasses. A parity test checks the foldedTBoxlists against the raw arrays the wrappers fill.