Add std.meta.applyLeft and std.meta.applyRight#3798
Conversation
std/meta.d
Outdated
There was a problem hiding this comment.
Oops, what I wanted to test here was type/symbol results. Will rewrite this test.
|
Sorry, I have not paying attention to Phobos for quite a long time. |
d6c6b9c to
c31f35f
Compare
|
The unit tests now also test alias results. |
|
LGTM |
std/meta.d
Outdated
| */ | ||
| template applyLeft(alias Template, args...) | ||
| { | ||
| static if(args.length) |
There was a problem hiding this comment.
Nitpick: space between if and (.
|
Other than that, LGTM. |
|
LGTM, not sure why I never thought to write these myself. |
|
@JakobOvrum any chance you could fix those missing spaces? I'd love to see this merged. |
c31f35f to
b04a0ea
Compare
|
Fixed the spaces, but of course anyone with merge rights could just merge and fix such tiny issues themselves to speed up the process. |
|
Auto-merge toggled on |
Add std.meta.applyLeft and std.meta.applyRight
|
Let's just get the queue moving again, and leave minor improvements to followup PRs. |
|
These should have been CamelCased because they return templates, not values. Can we please get this fixed before the release? |
|
This shouldn't have been merged in the first place. Not only was there the issue of following the naming conventions; as it turns out, the implementation is woefully under-tested and unsurprisingly also broken. See, for example, #4374, or the fact the unit-tests don't seem to cover the zero-argument case (although it doesn't seem that it would need to be treated differently in the first place, except maybe as an exercise in premature optimisation). Having ostensibly trivial helpers such as this in Phobos only makes sense if they actually work reliably in all cases. |
This should help eliminate a lot of tiny helper templates, including those that tend to be visible in template constraints despite not being documented anywhere.
Ping @Dicebot, @John-Colvin in case there's something about std.meta I should know about before adding new functionality to it.