Skip to content

Instantly share code, notes, and snippets.

@picanumber
Created November 23, 2016 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save picanumber/1819fc09725534c023a52e6d79ffcee3 to your computer and use it in GitHub Desktop.
Save picanumber/1819fc09725534c023a52e6d79ffcee3 to your computer and use it in GitHub Desktop.
struct Comp
{
template <class F1, class F2>
auto operator()(F1&& lhs, F2&& rhs)
{
return [
lhs = perfect_capture_t<F1>(std::forward<F1>(lhs)),
rhs = perfect_capture_t<F2>(std::forward<F2>(rhs))
](auto&&... args)
{
return lhs(rhs(std::forward<decltype(args)>(args)...));
};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment