fork(4) download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <typeinfo>
  5.  
  6. template<class First>
  7. void func()
  8. {
  9. std::cout << typeid(First).name() << std::endl;
  10. }
  11.  
  12. template<class First, class Second, class... Rest>
  13. void func()
  14. {
  15. func<First>();
  16. func<Second, Rest...>();
  17. }
  18.  
  19.  
  20. class Hoge
  21. {
  22. };
  23.  
  24. int main()
  25. {
  26. func<int, double, std::vector<int>, std::string, Hoge>();
  27. }
  28.  
Success #stdin #stdout 0s 2828KB
stdin
Standard input is empty
stdout
i
d
St6vectorIiSaIiEE
Ss
4Hoge