class A
{
std::string name;
public:
A(const A & rhs)
{
name = rhs.name;
}
};
In copy constructor of class A above, will the assignment operator of string class is called or copy constructor of string class?
name data member is not defined yet, so wouldn’t the copy constructor be called?
Assignment operator. If you want copy constructor: