Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. namespace cranberries {
  2. namespace cranberries_magic {
  3. template < class F, class G >
  4. struct curried_proxy {
  5. F f;
  6. G g;
  7. template < class... Args >
  8. constexpr decltype(auto) operator()(Args&&... args) const
  9. noexcept(noexcept(f(g(std::forward<Args>(args)...))))
  10. {
  11. return f(g(std::forward<Args>(args)...));
  12. }
  13. };
  14.  
  15. } // ! namespace cranberries_magic
  16.  
  17. template < class F, class G >
  18. cranberries_magic::curried_proxy<std::decay_t<F>, std::decay_t<G>>
  19. constexpr operator * (F&& f, G&& g) noexcept {
  20. return { std::forward<F>(f), std::forward<G>(g) };
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement