Skip to content
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

Type Aliases for Generators and Predicates #540

Closed
4 tasks done
SSoelvsten opened this issue Sep 24, 2023 · 0 comments · Fixed by #541
Closed
4 tasks done

Type Aliases for Generators and Predicates #540

SSoelvsten opened this issue Sep 24, 2023 · 0 comments · Fixed by #541
Assignees
Labels
✨ code quality Uncle Bob would be proud

Comments

@SSoelvsten
Copy link
Owner

SSoelvsten commented Sep 24, 2023

Currently, the public API is using std::function<...> in many places. We should replace std::function with a adiar::function alias, such that we can (if need be) implement our own alternative to std::function (for example, #200 might call for it).

  • std::function<...> -> adiar::function<...>

Furthermore, it is hard to figure out what the purpose of the function is merely based on the type (without reading the documentation). We ought to provide much easier to read type aliases:

  • std::function<bool(label_t) -> adiar::predicate<label_t>
  • std::function<void(label_t) -> adiar::consumer<label_t>
  • std::function<label_t() -> adiar::coroutine<label_t> or adiar::producer<label_t>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ code quality Uncle Bob would be proud
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant