I would like to wrap the random number distributions from the C++11 standard library with simple functions that take as arguments the distribution\'s parameters and a genera
To ensure there is no hidden state within the distribution, is it 1) necessary
Yes.
and 2) sufficient to call reset() on the distribution each time?
Yes.
You probably don't want to do this though. At least not on every single call. The std::normal_distribution
is the poster-child for allowing distributions to maintain state. For example a popular implementation will use the Box-Muller transformation to compute two random numbers at once, but hand you back only one of them, saving the other for the next time you call. Calling reset()
prior to the next call would cause the distribution to throw away this already valid result, and cut the efficiency of the algorithm in half.