Re: [Boost-bugs] [Boost C++ Libraries] #599: uniform_01 copies engine instead of using a reference

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #599: uniform_01 copies engine instead of using a reference
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-11-16 20:43:04


#599: uniform_01 copies engine instead of using a reference
---------------------+------------------------------------------------------
  Reporter: uhoreg | Owner: jmaurer
      Type: Bugs | Status: reopened
 Milestone: | Component: random
   Version: None | Severity:
Resolution: | Keywords:
---------------------+------------------------------------------------------
Changes (by azzie_at_[hidden]):

  * status: closed => reopened
  * resolution: Fixed =>

Comment:

 I still haven't found this warning in http://www.boost.org/libs/random/
 random-distributions.html#uniform_01 and encountered the same problem.
 Please make clear that drawing a number from uniform_01 will NOT change
 the state of the passed generator. And why to pass the generator as a non-
 const reference if it is not being changed?

 I suggest making the constructor argument (the reference to the generator)
 of uniform_01 const and pointing the users to uniform_real which works as
 expected (changes the state of the generator after drawing a number).

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/599#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC