Since the generator is an object of the function, you can instantiate the generator and provide arguments to its constructor:
class MyGenerator { private: int startValue; public: MyGenerator(int startValue): startValue(startValue) {}
Then, each time you create, you can use startValue and rand to calculate the following parameters that will be used to create your object A.
Doug T.
source share