Setting this to something else
-
Hi, I'm looking for a way to change what this points to. I want to make a function that essentially does this = new InstanceOfAClass(value, this), for a linked list, but but I can't figure out how. I feel like this is a pretty basic question, but I can't find the answer. Thanks, -Ken
-
Hi, I'm looking for a way to change what this points to. I want to make a function that essentially does this = new InstanceOfAClass(value, this), for a linked list, but but I can't figure out how. I feel like this is a pretty basic question, but I can't find the answer. Thanks, -Ken
Assigning a value to "this" is no longer allowed. You should be creating new object instances, possibly with the help of proper copy semantics - assignment operator overloading and copy constructor. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Assigning a value to "this" is no longer allowed. You should be creating new object instances, possibly with the help of proper copy semantics - assignment operator overloading and copy constructor. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Haha, that explains why my attempts to do it all failed. Thanks, -Ken