fork(1) download
  1. #include <string>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. template<typename Type>
  6. void func(Type, Type)
  7. {
  8. cout << "same" << endl;
  9. }
  10.  
  11. template<typename TypeA, typename TypeO>
  12. void func(TypeA, TypeO)
  13. {
  14. cout << "different" << endl;
  15. }
  16.  
  17. int main()
  18. {
  19. func(5, 3); // same
  20. func(5, 3.0); // different
  21. func(string("hello"), "hello"); // different
  22. func(5.0, 3.0); // same
  23. return 0;
  24. }
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout
same
different
different
same