fork download
  1. #include<set>
  2.  
  3. template<typename T, typename T2 = void>
  4. struct MySet
  5. {
  6. std::pair<T,bool> insert (const T& i) { return std::pair<T,bool>(T(),true); }
  7. std::pair<T,bool> insert (T&& i) { return std::pair<T,bool>(T(),true); }
  8. void insert (std::initializer_list<T> i) { return false; }
  9. };
  10.  
  11. template<typename Return, typename T>
  12. T ReceiveFuncPtr (Return (T::*Method)(const int&))
  13. {
  14. T obj;
  15. (obj.*Method)(1);
  16. return obj;
  17. }
  18.  
  19. int main ()
  20. {
  21. ReceiveFuncPtr(&MySet<int>::insert); // OK
  22. }
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty