Remove the reference in the type: remove_reference

#define debug qDebug()<<
int main(int argc, char *argv[])
{
    std::remove_reference<int&>::type d;
    d = 6;
    debug d;
}

std::remove_reference<int&>::type removes the reference in int&, the result is int, which is equal to:

    int d;
    d = 6;

application:

    int a = 3;
    int &r = a;
    std::remove_reference<decltype(r)>::type d;
    d = 6;
    debug d;

 

Guess you like

Origin blog.csdn.net/kenfan1647/article/details/113744417