Hi I asked a question today about How to insert different types of objects in the same vector array and my code in that question was
gate* G[1000];
G[0] =
The best way to add different objects into same container is to use make_shared, vector, and range based loop and you will have a nice, clean and "readable" code!
typedef std::shared_ptr Ptr
vector myConatiner;
auto andGate = std::make_shared();
myConatiner.push_back(andGate );
auto orGate= std::make_shared();
myConatiner.push_back(orGate);
for (auto& element : myConatiner)
element->run();