Skip to content

Conversation

@pbackus
Copy link
Owner

@pbackus pbackus commented Feb 3, 2025

Previously, code that already knew the desired index was forced to compute a type to pass to get!T or memberName!T, just for get!T or memberName!T to turn that type back into an index. Removing this unnecessary round trip simplifies the code.

Additionally, since memberName is no longer dependent on SumType.Types, it can be moved to module scope, and its instantiations can be shared across different SumType instances.

Phobos PR: dlang/phobos#10633

Previously, code that already knew the desired index was forced to
compute a type to pass to get!T or memberName!T, just for get!T or
memberName!T to turn that type back into an index. Removing this
unnecessary round trip simplifies the code.

Additionally, since memberName is no longer dependent on SumType.Types,
it can be moved to module scope, and its instantiations can be shared
across different SumType instances.

Phobos PR: dlang/phobos#10633
@pbackus pbackus merged commit ee35912 into master Feb 3, 2025
10 checks passed
@pbackus pbackus deleted the access-by-index branch February 3, 2025 17:00
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