On 17 Aug 2009, at 04:51, Diederick C. Niehorster wrote:
I have decided to try to do without the whole singleton (although I don't really see what the point is of avoiding a singleton if we still have a global pointer, its almost the same thing) as an exercise and try out Kevin's implementation.
A singleton is extra code and extra work to maintain. Why create yourself more classes, more namespace pollution, and a more complex system when it is not necessary. I think I am just anti singleton. I believe it is far too overused, and apart from in a few niche cases provides nothing but additional complexity.
Hmm, i have tried so, but the syntax to actually extract the random numbers becomes very complicated now (I think i am missing a point here, i am new to boost.function).
Your method 2 is the one I use (except I use =) I wouldn't say it is a
lot of typing, or particularly complicated, most editors will let you
autocomplete the grng_function and the distribution name, so it's only
about 15 keystrokes. In fact it is no different to
CRandom