Tuesday, June 7, 2016

[C++] Clone

class Test { private: blah blah; public: blah blah blah; Test* Clone() const { return new Test(*this); } } // Caution : Maybe, deep copy is necessary if there is/are pointer variable(s)

No comments: