[quote]Hi I would like to make a dynamically sized array of TPad Objects and
nothing I try seems to work. I have tried:
Could someone offer me some helpful advice. Thanks.
std::vector requires it’s value_type to be copy-constructible and copy-assignable. TPad is not - it has private copy-asisgnment operator and copy-constructor (AFAIK they are even not implemented, only declared).
And this is not bad, vector (during it’s modifying operations) can reallocate memory and copy objects into this new place, it will be really bad to copy big array of TPad’s, they are havy-weight objects.
You can use array of pointers to TPads (or vector of such pointers), but the best (IMHO) for you situation solution is to use ROOT’s specific container for TObject’s inherited objects - TObjArray (somthing like this, I didn’t check this code):
//I think, you can even do arr.SetOwner(kTRUE); not to delete TPads
//yourself, TObjArray must do it for you.
You cannot use std::vector with TPad, even if you compiler managed to compile this - such code is ill-formed in C++ terms.
C++ standard requires vector’s value type to be copy-constructible and copy-assignable, TPad (at least in CVS head) is not.