0
#include <iostream>

using namespace std;

int main()
{
    cout << typeid(int).name() << endl;
    cout << typeid(int&).name() << endl;
    cout << typeid(int&&).name() << endl;
}

The output is:

int

int

int

My compiler is clang 5.0.

Why are the typeids of int, int&, and int&& same?

xmllmx
  • 39,765
  • 26
  • 162
  • 323

0 Answers0