> FacilityModel* new_model = new FacilityModel( old_model );
When I see the 'new' operator, it's obvious that a new object has been born on the heap, and that the pointer should be delete-d later. An assignment operator (operator=) can work similarly.
I notice that Model::copy() is a virtual function. If the arrangement of your class hierarchy make copying by copy constructors impractical, you may need to stick with a copy function. (Read about "virtual constructors" [1] for some of the subtleties involved.) This is basically what Robert is recommending.
My own tendency is to prefer the existing idiom. The argument against
> FacilityModel* new_model = old_model.copy();
is that it isn't as clear, without extra documentation, whether .copy() returned a new-ly allocated object, or who is responsible for deleting that object later. If you had a function like that, I'd recommend naming it something like make_new_deep_copy() or clone() [2], to help the reader realize that a new object is being allocated.
~S
[1]: http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.8 (You'll notice me referencing this site often-- the entire C++ FAQ is very useful!)
[2]: I believe clone() is more common as the name of a virtual copy constructor than copy() is. This is probably due in part to the use of clone() for this purpose in Java.
My own tendency is to prefer the existing idiom. The argument against
> FacilityModel* new_model = old_model.copy();
is that it isn't as clear, without extra documentation, whether .copy() returned a new-ly allocated object, or who is responsible for deleting that object later. If you had a function like that, I'd recommend naming it something like make_new_deep_copy() or clone() [2], to help the reader realize that a new object is being allocated.