uniform_01, does it actually work?

Doesn't look like it: /usr/local/src/boost.hg/boost/random/variate_generator.hpp:120: error: no type named ‘input_type’ in ‘class boost::uniform_01<boost::random::mersenne_twister<unsigned int, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18, 3346425566u>, double>’

Neal Becker wrote:
Doesn't look like it: /usr/local/src/boost.hg/boost/random/variate_generator.hpp:120: error: no type named ‘input_type’ in ‘class boost::uniform_01<boost::random::mersenne_twister<unsigned int, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18, 3346425566u>, double>’
What code/compiler combination generates this? John.

John Maddock wrote:
Neal Becker wrote:
Doesn't look like it: /usr/local/src/boost.hg/boost/random/variate_generator.hpp:120: error: no type named ‘input_type’ in ‘class boost::uniform_01<boost::random::mersenne_twister<unsigned int, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18, 3346425566u>, double>’
What code/compiler combination generates this?
Different subject, from uniform_01 doc: WARNING: As an exception / historic accident, this class takes a UniformRandomNumberGenerator as its constructor parameter, and BY VALUE. Usually, you want reference semantics so that the state of the passed-in generator is changed in-place and not copied. In that case, explicitly supply a reference type for the template parameter UniformRandomNumberGenerator. OK, but what about: from uniform_01.hpp: base_type& base() { return _rng; } So, for example: #include <boost/random.hpp> typedef boost::mt19937 rng_t; struct F { F (rng_t & r) : gen (r){} double operator()() { return gen(); } boost::uniform_01<rng_t&> gen; }; /usr/local/src/boost.hg/boost/random/uniform_01.hpp:53: error: forming reference to reference type ‘rng_t&’

Neal Becker wrote:
OK, but what about: from uniform_01.hpp: base_type& base() { return _rng; }
So, for example: #include <boost/random.hpp>
typedef boost::mt19937 rng_t; struct F { F (rng_t & r) : gen (r){}
double operator()() { return gen(); }
boost::uniform_01<rng_t&> gen; };
/usr/local/src/boost.hg/boost/random/uniform_01.hpp:53: error: forming reference to reference type ‘rng_t&’
:-( Can you file tracker issues on all these at svn.boost.org so they don't get lost? Thanks, John.
participants (2)
-
John Maddock
-
Neal Becker