Guest User

Untitled

a guest
Oct 18th, 2015
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. template< typename R, typename ... Args >
  2. struct cool_object_t {
  3.     using fn_type = std::function< R (Args...) >;
  4.     fn_type func;
  5.     cool_object_t (fn_type fn) : func (fn) {}
  6. };
  7.  
  8. template< typename R, typename ... Args >
  9. auto cool_object (std::function< R (Args...) > t) {
  10.     return cool_object_t<R, Args...> (t);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment