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

simplify registerFunction #11230

Open
qicosmos opened this issue Oct 11, 2024 · 0 comments
Open

simplify registerFunction #11230

qicosmos opened this issue Oct 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@qicosmos
Copy link

Description

current registerFunction need to fill many argument types:

template <typename TExecParams>
struct MyPlusFunction {
  FOLLY_ALWAYS_INLINE void
  call(int64_t& out, const int64_t& a, const int64_t& b) {
    out = a + b;
  }
};

registerFunction<MyPlusFunction, int64_t, int64_t, int64_t>({"my_plus"});

I think it can be simplified:

registerFunction<MyPlusFunction>({"my_plus"});

Because the argument types can be trait by function traits.

@qicosmos qicosmos added the enhancement New feature or request label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant