I'm trying to teach myself about how to use copy constructors and assignment operators.
I'm trying to realize a RAII class for handles.
I found this example here:
Now I'm trying to implement the assignment operator like this:
Code:
HandleType& operator=(const HandleType& value) { DuplicateHandle(reinterpret_cast<HandleType>(-1), value, reinterpret_cast<HandleType>(-1), &_value, 0, false, DUPLICATE_SAME_ACCESS); return *this; }
processHandle_ should have a different value than processHandle because of the DuplicateHandle function, but it doesn't.
What am I doing wrong? Do you need to see more of the code?
Thanks in advance.