[cfe-dev] std::tr1::variate_generator

Steven Watanabe watanabesj at gmail.com
Thu Apr 5 14:39:42 PDT 2012


On 04/05/2012 02:00 PM, Fletcher, John P wrote:
> Hello
> I am attempting to convert some code which compiles with g++ 4.4 to work with Clang31 and libc++.
> The code includes  <tr1/random> which exists in the g++ includes but not in libcxx/include.

libc++ implements C++11, not TR1.  variate_generator
didn't make it into the standard.

> libc++ does have a file <random> which does have most of the things needed but not the template class variate_generator defined like this in <tr1/random>
>   template<typename _Engine, typename _Dist>
>     class variate_generator
> Is there an equivalent in libc++ or should I just import the g++ 4.4 file?
> Thanks
> John
> P.S.  The full set of defines being made in the code are:
>     std::tr1::mt19937 uint_gen;
>     std::tr1::uniform_real<double> uniform_dist;
>     std::tr1::variate_generator< std::tr1::mt19937, std::tr1::uniform_real<double> > uniform_gen;
>     std::tr1::normal_distribution<double> normal_dist;
>     std::tr1::variate_generator< std::tr1::mt19937, std::tr1::normal_distribution<double> > normal_gen;

In Christ,
Steven Watanabe

More information about the cfe-dev mailing list