I have a class defined as:
class ExampleClass
{
public:
ExampleClass(HWND hwnd);
~ExampleClass();
....
....
....
}
which has many members. Later, I created 2 pointers:
ExampleClass *example1 = new ExampleClass(hwndFrame1);
ExampleClass *example2 = new ExampleClass(hwndFrame2);
Here hwndFrame1 and hwndFrame2 are handles of two different windows.
At some point, I need to sync the values of all the members of these two classes pointed by example1 and example2. Of course I can do this each member by each member. But I wonder if there is a “one-go” solution for this.
Lacking any further information I would suggest:
If
ExampleClassis using the compiler declared copy assignment operator this should do a memberwise copy, otherwise it should do “the appropriate thing”. Obviously the two objects being pointed to will refer to the same underlying window after this.