fork download
  1. #include <set>
  2.  
  3. struct Base
  4. {
  5. virtual int F(int);
  6. };
  7.  
  8. struct Derived : public Base
  9. {
  10. int F(int);
  11. };
  12.  
  13. template<typename Type, typename Return, typename Parameter, Return (Type::*)(Parameter)> struct W
  14. {
  15. };
  16.  
  17. int main(int argc, char **argv)
  18. {
  19. typedef std::set<int> setint;
  20.  
  21. std::pair<setint::iterator, bool> (setint::*p_1)(const setint::value_type &) = &setint::insert;
  22. W<setint, std::pair<setint::iterator, bool>, const setint::value_type &, &setint::insert> w_1;
  23.  
  24. int (Derived::*p_2)(int) = &Derived::F;
  25. W<Derived, int, int, &Derived::F> w_2;
  26.  
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0.01s 2676KB
stdin
Standard input is empty
stdout

Standard output is empty