It has a template class variate_generator which overloads the () operator.
It is used as follows:
// random engine, distribution
boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(rng, six);
// rng and six have been defined earlier
//we can now use the overloaded operator () to draw a number:
int x = die();
MY PROBLEM:
I need to hold an instance of class variate_generator and regularly draw numbers.
Hi Alex,
If I understand correctly, (*(this->pDie))()
should do it.
first, the pointer is obtained from "this" (unnecessary by the way...you can just use pDie inside the class).
second, the pointer is dereferenced to give you the object it is pointing to.
last, you access the function call overload for the object.