#include <iostream>
#include <string>
using namespace std;
class A
{
public:
A();//default
A(A &);//copy
A & operator= (const A &);//equal
explicit A(string str);//string
};
A::A(string str)
{
cout << "string" << endl;
}
A::A()
{
cout << "default" << endl;
}
A & A :: operator= (const A &other)
{
cout << "=" << endl;
return *this;
}
A::A(A &a)
{
cout << "copy" << endl;
}
int main()
{
A a;
A b(a);
A c = a;
A d;
d = a;
A v = A("fsdfa");
return 0;
}
#include <string>
using namespace std;
class A
{
public:
A();//default
A(A &);//copy
A & operator= (const A &);//equal
explicit A(string str);//string
};
A::A(string str)
{
cout << "string" << endl;
}
A::A()
{
cout << "default" << endl;
}
A & A :: operator= (const A &other)
{
cout << "=" << endl;
return *this;
}
A::A(A &a)
{
cout << "copy" << endl;
}
int main()
{
A a;
A b(a);
A c = a;
A d;
d = a;
A v = A("fsdfa");
return 0;
}