Here is a class I've created:
class A{
private:
// some private data members:
// 2 const integers
// 2 integers
// 2 const strings
public:
// C'tor
// D'tor
void f(const A&);
}
In the constructing of every object of this class there are no (explicit) dynamic allocations, only "primitive" types assignments. (by no explicit dynamic allocations i mean other than how string class handles memory).
when i try this:
void f(const A& item){
// do some thing
*this = item;
// do other stuff
}
i get the following error: "use of deleted function 'A& A::operator=(const A&)' "
now i know that the compiler is supposed to provide me a default assignment operator, and my question is: why the compiler refers to it's default assignment operator as a deleted function? and how do i fix this without assigning all the data member functions manually?
Thanks a lot! Gal