clone pattern version2 C++