Re: [Boost-bugs] [Boost C++ Libraries] #2788: boost::uniform_01<> template parameter mistake

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2788: boost::uniform_01<> template parameter mistake
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-21 16:08:27


#2788: boost::uniform_01<> template parameter mistake
--------------------------------------+-------------------------------------
  Reporter: rick68_at_[hidden] | Owner: steven_watanabe
      Type: Patches | Status: closed
 Milestone: Boost 1.39.0 | Component: random
   Version: Boost Development Trunk | Severity: Problem
Resolution: invalid | Keywords:
--------------------------------------+-------------------------------------
Changes (by steven_watanabe):

  * status: new => closed
  * resolution: => invalid

Comment:

 Yes. That's expected. The code shouldn't have compiled before my changes
 either.

 {{{
 #include <boost/random.hpp>

 int main(void) {
     boost::uniform_01<boost::mt19937> rng; // illegal--no default
 constructor

     boost::mt19937 rng;

     // ok. Old implementation. Copies rng.
     boost::uniform_01<boost::mt19937> dist(rng);
     double x = dist();

     // ok. Modification of old implementation.
     // stores a reference to rng.
     boost::uniform_01<boost::mt19937&> dist(rng);
     double x = dist();

     // ok. new implementation
     boost::uniform_01<> dist;
     double x = dist(rng);

     return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2788#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:59 UTC