Object's type in a has-a relationship - C++
问题 Consider the following code (also available at C++ Shell). Basically, we have an Employee base class with FullTime and PartTime subclasses. The organization class HAS a list of Employees (who could be Fulltime or PartTime). The problem arises when I want to define a getEmployee(int) method in the Organization class. What type of Employee should it return? If it returns a Employee*: first of all, is it safe to return a pointer? I assume that its address is permanent, because it will send the