c++ how to create a class with copy constructor