I have an abstract class "A" with a vector containing pointers to objects "B". There are two different derived classes from the class "B", and they have an update function with different arguments. Each of classes derived from "B" may or may not be used in "A". I wonder how I would make that so the general update function in "A" could take only arguments, that are needed, so if there isn't B1 it wouldn't take an argument 1, if there isn't B2 it wouldn't take argument 2 and so on? Is there maybe some pattern I could use?