How C++ reference works

前端 未结 5 1150
别那么骄傲
别那么骄傲 2020-12-17 05:54

After working 15 years in C++ I found that I don\'t understand references completely...

class TestClass
{
public:
    TestClass() : m_nData(0)
    {
    }

    T         


        
5条回答
  •  没有蜡笔的小新
    2020-12-17 06:42

    1) you can't get not const reference to a temporary object

    2) in the line c = TestClass(10); operator=(...) is called

提交回复
热议问题