Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace cranberries {
- namespace cranberries_magic {
- template < class F, class G >
- struct curried_proxy {
- F f;
- G g;
- template < class... Args >
- constexpr decltype(auto) operator()(Args&&... args) const
- noexcept(noexcept(f(g(std::forward<Args>(args)...))))
- {
- return f(g(std::forward<Args>(args)...));
- }
- };
- } // ! namespace cranberries_magic
- template < class F, class G >
- cranberries_magic::curried_proxy<std::decay_t<F>, std::decay_t<G>>
- constexpr operator * (F&& f, G&& g) noexcept {
- return { std::forward<F>(f), std::forward<G>(g) };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement