Is there any effect of allocating memory using 'new' inside an object that itself was allocated using new. Is there any advantage or disadvantage on the compiler, linker, run-time performance or anything?
An example of what I'm talking about
class IntData
{
public:
IntData()
{
IntVector = new std::vector<int>();
//...
}
protected:
std::vector<int> *IntVector; //Would this be any different to static allocation if...
};
//...I know that all IntData objects will be dynamically allocated
IntData *object = new IntData();