fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. template<typename type, class container>
  7. struct A
  8. {
  9. void say() { std::cout << "Say for all" << std::endl;}
  10. };
  11.  
  12. template<typename type>
  13. struct A<type,vector<type>>
  14. {
  15. void say()
  16. {
  17. std::cout << "Say for vector" << std::endl;
  18. }
  19. };
  20.  
  21. int main(int argc, char * argv[])
  22. {
  23. A<int,vector<int>> a;
  24. A<int,double> b;
  25. a.say();
  26. b.say();
  27. }
  28.  
  29.  
Success #stdin #stdout 0.01s 5656KB
stdin
Standard input is empty
stdout
Say for vector
Say for all