I work on a server with GCC version 4.4.7, and I am forced to work with this version, unfortunately. I want to use the library <random>for C ++ 0x, but I read here what is uniform_real_distributioncalled in this version uniform_real. When I try to call this function and normal_distribution, I do not get a useful output. See this example:
#include <random>
#include <iostream>
using namespace std;
int main()
{
typedef std::mt19937 Engine;
typedef std::uniform_real<double> Dis1;
typedef std::normal_distribution<double> Dis2;
Engine eng(0);
Dis1 dis1(0, 1);
cout << dis1(eng) << endl;
Dis2 dis2(0, 1);
cout << dis2(eng) << endl;
return 0;
}
I compile with g++44 -std=c++0x main.cpp, and I showed what result I get. What is the problem?
source
share