fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. class C {};
  7.  
  8. template<class T>
  9. class PriorityQueue {
  10. public:
  11. void add() { cout<<"add"<<endl; }
  12. T remove() { cout << "general"<<endl; return T(); }
  13. };
  14.  
  15. template<>
  16. string PriorityQueue<string>::remove() { cout << "special"<<endl; return ""; }
  17.  
  18.  
  19. int main() {
  20. PriorityQueue<string> q;
  21. q.remove();
  22. q.add();
  23.  
  24. PriorityQueue<int> p;
  25. p.remove();
  26. p.add();
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
special
add
general
add