Skip to content

Conversation

travisdowns
Copy link
Contributor

  • Use std::invoke to call the passed function, rather than a direct call. This allows member function pointers and other callable types to be used. This is already the case in other calls like future_invoke.
  • Forward the function itself, not just the arguments. This allows an rvalue-qualified operator() to be called if present.

This is good for a 0.06% reduction in the .text section of the release redpanda binary, so I guess we do have some && call operators?

The real reason for this though is the std::invoke part. Later I build on this.

 - Use std::invoke to call the passed function, rather than a direct
   call. This allows member function pointers and other callable types
   to be used. This is already the case in other calls like
   future_invoke.
 - Forward the function itself, not just the arguments. This allows
   an rvalue-qualified operator() to be called if present.

This is good for a 0.06% reduction in the .text section of the release
redpanda binary, so I guess we do have some && call operators?

The real reason for this though is the std::invoke part. Later I build
on this.

template<typename T>
template<typename Func, typename... FuncArgs>
typename futurize<T>::type futurize<T>::invoke(Func&& func, FuncArgs&&... args) noexcept {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Forward the function itself, not just the arguments. This allows
    an rvalue-qualified operator() to be called if present.

950b54e beat you to it, so now you get to rebase and I get to re-run CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah haha, weird how it was like that for 8 years or whatever then suddenly two very similar changes collide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants