Boost logo

Boost :

From: Oliver Kullmann (O.Kullmann_at_[hidden])
Date: 2004-06-23 14:53:48

> --- Oliver Kullmann <O.Kullmann_at_[hidden]> wrote:
> > The problem with the "very quick start" is, that
> > without already understanding the architecture of
> > the library it seems impossible to understand it.
> Actually, there was a major change in the library
> architecture between boost versions 1.30 and 1.31.
> The change had to do with conformance to the WG21
> specification, available at this link:
> <>

aha, thanks for the link; I was aware only of the general
Technical Report on Standard Library Extensions (Draft),
which I found actually more helpful than the Boost
> > > boost::variate_generator<BaseRNG&,UniformDist>
> > > your_generator(rng, dist);
> > >
> > > Note the ampersand; your program will fail
> > > silently if you omit it.
> >
> > I don't understand the need for the reference type
> > --- otherwise the object rng would be copied, which
> > should also be alright?!
> Nope. Without the reference type, a call like:
> int random_number = your_generator();
> would invoke the constructor instead of the () member
> operator; hence, the silent failure.

I don't understand this. According to the draft (N1648, available at
section 5.1.3, just using a non-reference type BaseRNG should work.

> > Perhaps one should emphasise, that models of
> > pseudo-random generators are models of uniform
> > random generators,
> Yes, it says so in the concept documentation, which
> the reader is told to look at first, although the
> "emphasis" is rather weak, IMHO.

I just feel that the whole concept of "concepts" and "models" is
not so easy to grasp, and thus I think it would be beneficial to
say things several times.

> > and that also for example uniform_int yields a model
> > of a uniform random generator.
> Not quite. uniform_int models a uniform distribution
> over which random number generators should generate
> random numbers. variate_generator is the front-end
> number generator that applies the distribution
> constraint to the base random number generator.

In the draft, section it says, that "a uniform_int
random distribution satisfies all the requirements of a uniform
number generator", and I guess that means that uniform_int
is a model of a uniform random generator, or?!
> > Inclusion of something like the above explanations
> > into the documentation would already help a lot!
> Ideally, it would be so. The problem here is when
> Jens Maurer will find the time; presumably he's also
> working on improving the above-mentioned WG21 spec and
> preparing for the upcoming 1.32 release.

Of course; I just hope that this little e-mail stream
might already help for some improvements (and every
bit helps).


Boost list run by bdawes at, gregod at, cpdaniel at, john at