I\'m designing a simple Array
class with the capability of holding any type of object, like a vector that can hold multiple types of data in one object. (This i
The return type of a function like Array::get_element
must be determined at compile time. Since class Array
does not know what types of containers it stores at compile time, the only option is to just return the base Container*
pointer. Then users of that code can use virtual functions and/or dynamic_cast
to deal with those generalized containers.