Skip to content

Make util::tuple::rank<N> a flat inheritance chain. - #1935

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1009274957
Nov 3, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1009274957

Conversation

@copybara-service

Copy link
Copy Markdown

Make util::tuple::rank<N> a flat inheritance chain.

rank<N> used to expand to kMaxRank + 1 - N nested internal_rank::wrapper<>
class templates. That nesting existed only so rank<N, T> could order class
template partial specializations. Every function that takes a rank<N>
parameter carried that nesting in its symbol name: up to ~300 B mangled and
~1.4 KB demangled per parameter. The same nesting showed up as one DWARF type
per nesting level.

Overload resolution behaves the same: rank<N>
still converts to rank<M> for every M >= N, and the conversion is better
the smaller M is. The mangled name is now a short constant size.

The 2-argument rank<N, T> class-specialization form is removed; it has no
remaining users.

`rank<N>` used to expand to `kMaxRank + 1 - N` nested `internal_rank::wrapper<>`
class templates. That nesting existed only so `rank<N, T>` could order class
template partial specializations. Every function that takes a `rank<N>`
parameter carried that nesting in its symbol name: up to ~300 B mangled and
~1.4 KB demangled per parameter. The same nesting showed up as one DWARF type
per nesting level.

Overload resolution behaves the same: `rank<N>`
still converts to `rank<M>` for every `M >= N`, and the conversion is better
the smaller `M` is. The mangled name is now a short constant size.

The 2-argument `rank<N, T>` class-specialization form is removed; it has no
remaining users.

PiperOrigin-RevId: 1012859579
@copybara-service
copybara-service Bot merged commit 7ae1724 into main Nov 3, 2026
3 checks passed
@copybara-service
copybara-service Bot deleted the test_1009274957 branch November 3, 2026 10:58
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.

1 participant