The copy operator is one of the four functions that is generated for you if you don't specify them. If you don't specify CSampleClass& CSampleClass::operator=(const CSampleClass & node)
the compiler thinks you don't have a copy operator and generates one for you, which can get confused with yours.