daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. template<typename t, typename return_type, typename... xs>
  4. using memfun_ptr = return_type(t::*)(xs...);
  5.  
  6. template<typename t, typename u>
  7. void whatever(t datum, memfun_ptr<t, u> ptr)
  8. {
  9.     (datum.*ptr)();
  10. }
  11.  
  12. struct dupa
  13. {
  14.     void call()
  15.     {
  16.         printf("dupa\n");
  17.     }
  18. };
  19.  
  20. int main(void)
  21. {
  22.     dupa x{};
  23.     whatever<dupa, void>(x, &dupa::call);
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top