Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.27 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. why typeid returns that int and const int are same types
  2. if(typeid(int) == typeid(const int))
  3.        cout << "Same types"<< endl;
  4.        
  5. #include <type_traits>
  6.  
  7. if (std::is_same<int, const int>::value)
  8.     std::cout << "same typesn";
  9. else
  10.     std::cout << "different typesn";