-
-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue 17711: std.array.byPair ought to work with const AA's. #5668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
std/array.d
Outdated
| int[string] aa; | ||
| } | ||
| A a; | ||
| static assert(is(typeof(a))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... I'm not sure you need a special assert for this as you just declared it 😉
I'm going to go out on a limb, and say we don't need this extra test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the entire class definition? I'd tend to agree... I just thought it was extra insurance in case something else about the user's code may cause things to break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think you can nix the whole class definition, it isn't adding any clarity (and it also adds a couple of uncovered lines since you don't actually run it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks, guys! |
There's nothing about the implementation of
byPairthat precludes it from being used with const AA's, other than the way it's declared.