Refactor std.traits.EnumMembers#8260
Conversation
|
Thanks for your pull request and interest in making D better, @pbackus! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#8260" |
|
very beautiful and it passes CI. If I could merge I would. |
|
This might reduce memory consumption. Have you done any memory benchmarks on std.traits, @pbackus? |
| alias EnumSpecificMembers = AliasSeq!(); | ||
| } | ||
| } | ||
| import std.meta : Map = staticMap; |
There was a problem hiding this comment.
Why did you keep the alias Map instead of using the staticMap directly?
There was a problem hiding this comment.
I'm trying to start a trend. :)
More seriously: std.meta has a lot of weird naming inconsistencies—compare staticMap, Filter, and templateOr, for example. I think smoothing out these inconsistencies with renamed imports makes code easier to read, and would like to see the practice catch on in Phobos. With local imports, the potential for confusion is low, since one only has to scroll a few lines to see where the alias is defined.
There was a problem hiding this comment.
Ahh, good point. I guess an alias is lightweight enough to serve this purpose. ;)
Thanks. Keep up the awesome work.
No description provided.