If you would like to see the function class_friendOverload::class_friendOverload(const class_friendOverload&), which is my copy constructor, this is what it looks like:
1 2 3 4 5 6 7 8
class_friendOverload::class_friendOverload(const class_friendOverload& setClass)
{
this->m_value1 = setClass.m_value1;
for (int i = 0; i < 5; ++i)
{
this->m_array1[i] = setClass.m_array1[i];
}
}
I am trying to call the copy constructor. So it is not possible to call any type of constructor, and instead I should have it call something like a Clone() method?
Of course you may try to call the copy constructor, but there is no any sense. Your object is already constructed. In realty in this statement you create a temporary unnamed object that will be destroyed after semicolon.:)