You shouldn't create dummy objects just to do an assignment in the next step, every time you want a copy.
Especially if the object construction is expensive even when default constructed.
But the definitive reason for copy c'tors, is that pass by value for user defined types will be impossible. And then we will have no RAII.
As for assignment operators, imagine trying to write classes without it. How would generic (template) code look?
Many generic algorithms can operate on classes that are merely assignable, but without that feature, you'd have to call their d'tor yourself before "constructing" the objects again.
template <calls T)
void assign(T& a, T& b)
{
a.~T();
new (&a) (b);
}
Basically, that puts an unreasonable demand on classes that their d'tor must be public. Or they must have you algorithm as friend
.
Furthermore, this is unsafe. Constructors may throw, that's how they report errors, and if the T
copy c'tor does, than a
is in an undefined state following the destructor call.
The problem is that you took the decision of freeing the state of a
away from it. If we had used the assignment operator instead, the assignment would have still thrown, but it could have made sure that a
doesn't free it's state yet.