Last active
November 23, 2016 00:41
-
-
Save picanumber/77bbf4dea85b7e8beddf6bd67669b356 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Comp | |
{ | |
template <class F1, class F2> | |
auto operator()(F1 lhs, F2 rhs) | |
{ | |
return [=](auto... args) | |
{ | |
return lhs(rhs(args...)); | |
// ^^^^^^^^^^^^^^^^^ | |
}; | |
} | |
}; | |
template <class... Ts> | |
auto compose(Ts&&... args) | |
{ | |
using fld::Op; | |
return (Op<Comp>(std::forward<Ts>(args)) + ...).give(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment