phobos
phobos copied to clipboard
[WIP] Add std.meta.apply
TODO:
- [ ] add more tests which properly motivate this addition
- [ ] add changelog entry
Thanks for your pull request, @ZombineDev!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Doesn't Instantiate
already do something similar to this? Would it not be better to simply extend Instantiate
to do things you need?
bike-sheding: this should be named Apply
to conform with the naming conventions of the rest of std.meta
@schveiguy yes, unfortunately Instantiate
is similar, but not quite as useful and I don't think I can extend it. I need to add more tests which properly motivate this addition.
@JackStouffer I considered this, but it wasn't a clear call since it can be used with values (where apply
would be more appropriate) and with templates (where Apply
would be better). However the most important point is that apply
/ Apply
combines both behaviours, which brings a tremendous simplification to generic code that needs to be flexible.