fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3.  
  4. using namespace std;
  5.  
  6. template <class T>
  7. class A
  8. {
  9. public:
  10. using type = T;
  11. };
  12.  
  13.  
  14. int main(int argc, const char * argv[])
  15. {
  16. A<int> a;
  17. A<double> d;
  18. decltype(a)::type b;
  19. decltype(d)::type c;
  20. cout << typeid(b).name() << endl;
  21. cout << typeid(c).name() << endl;
  22. }
  23.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
i
d