Boost logo

Boost :

From: Cromwell Enage (sponage_at_[hidden])
Date: 2004-06-25 11:22:30


> -- Oliver Kullmann <O.Kullmann_at_[hidden]> wrote:
> > 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
>
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2004/#post_sydney)
> section 5.1.3, just using a non-reference type
> BaseRNG should work.

I'm assuming you meant N1647.

I'll try to code some test cases in which using a
non-reference type BaseRNG works (at least with the
compiler I'm using, MinGW 3.2), but in my limited
experience it hasn't worked so far.

> 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.

I'd vote for a more unified (Boost-wide) look-and-feel
of the library documentation that is loosely based on
SGI's STL website so that the ideas of "concept" and
"model" are reinforced in the library user's mind. I
believe that's what they're going to do with the
upcoming BoostBook documentation system, but it'll
take some time if that's going to happen.

I'm not sure your student has surfed through it
already, but in the meantime, he can study the STL
Programmer's Guide, hosted by SGI:

<http://www.sgi.com/tech/stl/>

The "Introduction" gives the definitions of "concept",
"model", and other imporant ideas; and the "Table of
Contents" applies the definitions to the various class
templates available in the STL. Your student should
find these resources especially useful since Boost
libraries are supposed to work well with (and maybe
become a part of) the C++ Standard Library (of which
STL is a major part).

> In the draft, section 5.1.7.1 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?!

Well, you can't call the () member operator of
uniform_int the way uniform number generators are
required to by table 5.1 of section 5.1.1, but
uniform_int does satisfy the random *distribution*
requirements set forth in table 5.3 of that same
section. I'm not sure if the table number and
associated caption in section 5.1.7.1 are typos, but
for an answer on that particular point you may have to
contact the report's author directly.

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

Agreed. I'll be on-and-off, though; my grandfather's
in bad health and the family needs my support.

                              Cromwell Enage

                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk