Boost logo

Boost Users :

Subject: Re: [Boost-users] [Random] uniform_int::operator()(Engine &, result_type)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-07-19 19:41:53


Hossein Haeri wrote:
> I was looking at the uniform_int<>'s reference page:
> and realised that there is no information whatsoever about what the following overload of its operator () does:
> template<typename Engine>
> result_type operator()(Engine & eng, result_type n) ;
> Do I understand it correctly that this generates a number in [min, n] (probably subject to some good conditions)?

No. It generates a number in [0, n). The purpose of this
overload is to allow variate_generator<Engine, boost::uniform_int<> >
to be a model of RandomNumberGenerator. I believe that this
was a mistake, since there is a separate random_number_generator
class template, but it needs to be maintained for backwards

In Christ,
Steven Watanabe

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at