One last question, it seems there is an ambiguity created when we inherit the members of g4vu in mplg as 'G4VPhysicsConstructor' and 'myPhysListGeneral' share a member called 'subInstanceManager'. What do you recommend as the best fix for this, making the inherited classes virtual as in:
class myPhysListGeneral : virtual G4VPhysicsConstructor, virtual G4VUserPhysicsList
or through specifying 'theParticleIterator' as a member of mplg as in:
G4VUserPhysicsList::theParticleIterator->reset();
or some iteration which specifies that theParticleIterator and its members are from g4vu. Neither of these seem to work for me.
Here is the compiler error for this problem to give evidence to my suspicions:
1 2 3
error: request for member 'subInstanceManager' is ambiguous
error: candidates are: G4VUPLManager G4VUserPhysicsList::subInstanceManager
G4VPCManager G4VPhysicsConstructor::subInstanceManager
If both of the classes define their own member with that name, I don't think virtual inheritance is going to help. I think you can just explicitly specify which parent class's version of the member you are referring to, but I may be wrong. this->G4VUserPhysicsList::subInstanceManager
Just to clarify, 'theParticleIterator' contains the subInstanceManager and it would have to be this item that is declared as a member of G4VUserPhysicsList, I believe.