phobos icon indicating copy to clipboard operation
phobos copied to clipboard

[WIP] Add std.meta.apply

Open PetarKirov opened this issue 6 years ago • 4 comments

TODO:

  • [ ] add more tests which properly motivate this addition
  • [ ] add changelog entry

PetarKirov avatar Dec 31 '17 15:12 PetarKirov

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.

dlang-bot avatar Dec 31 '17 15:12 dlang-bot

Doesn't Instantiate already do something similar to this? Would it not be better to simply extend Instantiate to do things you need?

schveiguy avatar Dec 31 '17 15:12 schveiguy

bike-sheding: this should be named Apply to conform with the naming conventions of the rest of std.meta

JackStouffer avatar Dec 31 '17 15:12 JackStouffer

@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.

PetarKirov avatar Dec 31 '17 15:12 PetarKirov