Skip to content

Instantly share code, notes, and snippets.

@alexgeek
Created November 26, 2022 12:58
Show Gist options
  • Select an option

  • Save alexgeek/b222fec6140438bd4541a39084dab7fd to your computer and use it in GitHub Desktop.

Select an option

Save alexgeek/b222fec6140438bd4541a39084dab7fd to your computer and use it in GitHub Desktop.
template<typename CallbackType>
struct callback_test final
{
callback_test(CallbackType&& callback)
: callback(std::forward<CallbackType>(callback))
{
}
template<typename... U>
auto operator()(U&&... u) -> decltype(std::declval<CallbackType>()(u...))
{
return callback(u...);
}
private:
void init();
CallbackType callback;
};
@gnu-enjoyer
Copy link

final

@alexgeek
Copy link
Author

final

huh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment