fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3. using namespace std;
  4.  
  5. int main() {
  6. typedef int distance;
  7. typedef int weight;
  8. distance d=10; weight w=20;
  9. auto s=d+w; // valid, d and w are just int
  10. cout << typeid(d).name() <<" " << typeid(w).name() <<" "<< typeid(int).name()<<endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 5536KB
stdin
Standard input is empty
stdout
i i i