copy constructor


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Eric on April 21, 2001 at 16:25:20:

Do we need to implement a copy constructor for our ecosystem?
I assume the list has a copy constructor defined, so implementing an ecosystem copy constructor would only be used to make a new ecosystem have its own copies of each creature and plant.
However, I don't see how we can make copies of the creatures in the list without knowing which type of creature each pointer is to call its constructor.
So do we need to have copy and operator= that go that deep, and if so how do we copy the values of the list pointers without storing type information(which the specs say we can't do)?


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]