我正在尝试使用C++ STD TechnicalReport1扩展来生成正常分布后的数字,但是这段代码(改编自本文):
mt19937 eng;
eng.seed(SEED);
normal_distribution<double> dist;
// XXX if I use the one below it exits the for loop
// uniform_int<int> dist(1, 52);
for (unsigned int i = 0; i < 1000; ++i) {
cout << "Generating " << i << "-th value" << endl;
cout << dist(eng) << endl;
}
Run Code Online (Sandbox Code Playgroud)
只打印1"Generating ..."日志消息,然后永远不会退出for循环!如果我使用我注释掉的发行版,它会终止,所以我想知道我做错了什么.任何的想法?
非常感谢!