Sorry if this is a duplicated question! I have two classes:
class A : public TObject{
//some parameters
};
class AContainer : public TObject, public std::vector<COMET::IDriftElectron*>{
//some mathods
};
Can I change the std::vector<COMET::IDriftElectron*> structure to std::vector<std::shared_ptr<COMET::IDriftElectron>>? Can I still store them into a ROOT TTree and TFile?
ROOT Version: 6.24.02 Platform: Linux Compiler: gcc11
The persistification of shared_ptrs, e.g. as data members, is not supported because of the semantic of the very class.
If I may, I would also discourage the design of classes inheriting from STL containers, and opt perhaps for encapsulation (this is a suggestion which is independent from ROOT).