Hello,

Say I want to create a class, that is going to contain a vector of some other objects. My question is this: Do you want the vector to contain the actual objects, or do you want the vector to contain pointers to dynamically allocated objects.

You can assume that there were be setters and getters for this vector, as well as functions to add and remove items.

In Java this wouldn't be an issue, but in C++ I don't know how to go abou it. If I create a vector of objects, then I can return it using a const reference, so no extra expensive copies are going to happen. But then again having a vector of pointers might come in handy at some other kind of operation, which I can't think of right now.

All comments are welcome. Thanks...