Okay so today in class she takes about 30mins or more to explain what she really meant and when it occurs.
Code:
object foo(object arg); // returns a type of object.
int main()
{
object one = stuff;
object two = foo(one);
return 0;
}
This red line is supposed to call the copy constructor but doesn't on our compiler due to some optimization(it returns the reference). She says this is what she ment all along, if I understand her correctly. If that was the case though she wouldn't have required the delete statement in the copy constructor.
Code:
object foo(object arg); //returns a type of object
int main()
{
object one= stuff;
object two= stuff;
two = foo(one);
return 0;
}
I'm pretty sure that this is what she originaly ment for why I needed the delete for the copy constructor. She no longer thinks this way I think. This for sure calls the assignment operator and she knows this(at least now she does).