J
john sun
Hi,
I don't understand one thing when authoring cp ctor. The below is simplified
class and cp constructor.
When initializing the data member, we use object ref TEST to access its
private member m_x. Why in this case it's allowed even m_x is private member
of object TEST?
Thanks very much!
John
class test
{
private:
int m_x;
public:
test(const test& TEST):m_x(TEST.m_x)
{
}
}
I don't understand one thing when authoring cp ctor. The below is simplified
class and cp constructor.
When initializing the data member, we use object ref TEST to access its
private member m_x. Why in this case it's allowed even m_x is private member
of object TEST?
Thanks very much!
John
class test
{
private:
int m_x;
public:
test(const test& TEST):m_x(TEST.m_x)
{
}
}