fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3. using namespace std;
  4. template <typename Type> void test_template(Type x){
  5. cout << x <<endl;
  6. cout << typeid(Type).name() << endl;
  7. }
  8. int main()
  9. {
  10.  
  11. test_template<int>(2);
  12. test_template<double>(3.0);
  13. return 0;
  14. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
2
i
3
d