
On 8/8/06, Neal Becker <ndbecker2@gmail.com> wrote:
template<class Engine> result_type operator()(Engine& eng)
is sometimes awkward. It doesn't allow compile-time inquiry of the engine properties by the distribution class. For example, I have a distribution that generates an integer of random bits of a fixed width. It is awkward that the distribution class can't get the engine bit width.
I'm certainly no expert on generic programming or random numbers, but couldn't you use something like this: struct my_distribution { enum { bit_width 4 }; //or int bit_width(void) { return(4); } //Other distribution code. }; Then, in your templated operator(), you could just do Engine::bit_width or eng.bit_width(). Does that make any sense? Jeremy