fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int sum (int a, int b)
  5. {
  6. cout <<" NOn template function "<<endl;
  7. return a+b;
  8. }
  9.  
  10. template <typename T>
  11. int sum ( const T & a, const T & b)
  12. {
  13. cout<<"Template Generated .."<<endl;
  14. return a+b;
  15. };
  16.  
  17.  
  18. int main(int argc, char ** argv)
  19. {
  20. cout <<sum(10,20)<<endl;;
  21. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
 NOn template function 
30