fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3.  
  4. class A {};
  5. class B {};
  6. class C {};
  7.  
  8. template<typename T>
  9. std::size_t constexpr getID() { return typeid(T).hash_code(); }
  10.  
  11. template<std::size_t N>
  12. struct FF
  13. {
  14.  
  15. };
  16.  
  17. int main()
  18. {
  19. std::cout << getID<A>() << std::endl;
  20. std::cout << getID<B>() << std::endl;
  21. std::cout << getID<C>() << std::endl;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
2243288116
1621135011
3641736028