Boost logo

Boost Users :

From: wave style (wavestyle_at_[hidden])
Date: 2006-05-17 11:40:50

  I have some strange behavior on win XP with VC 8.0 version and
boost::random library.
  When I use variate_generator helper template with uniform_01 distribution,
I always get an compiler error. like as:

    boost::mt19937 rng(time(0));
    boost::uniform_01<mt19937> u01(rng);
    boost::variate_generator<mt19937, uniform_01<mt19937> > die401(rng,

//compile info
error C2039: 'input_type' : is not a member of
        f:\my documents\visual studio
2005\projects\testboost\testrandom\testrandom.cpp(169) : see reference to
class template instantiation 'boost::variate_generator<Engine,Distribution>'
being compiled

Actually, the uniform_01 class doesn't declare a type named input_type in
uniform_01.hpp, because uniform_01 distribution can accept both
IntegerType and RealType UniformRandomGenerator. It seems that
variate_generator can not support the uniform_01.
However, I found the engine_helper struct be specialized for uniform_01 and
uniform_int_float in variate_generator.hpp. I got confused. It's
vc8.0compiler's bug?

How can I get a variate_generator for uniform_01 distribution?

Any feedback welcomed!!



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at