fork(13) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <typeinfo>
  4. #include <typeindex>
  5.  
  6. template <typename... Types>
  7. void Fill(std::vector<std::type_index>& vec)
  8. {
  9. vec.insert(vec.end(), {typeid(Types)...});
  10. }
  11.  
  12. int main()
  13. {
  14. std::vector<std::type_index> vec;
  15.  
  16. Fill<char, int, float>(vec);
  17. for (const auto& t : vec)
  18. {
  19. std::cout << t.name() << std::endl;
  20. }
  21. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
c
i
f