我std::variate_generator
在一个VS2010项目中使用如下方式:
#include <random>
...
using std::variate_generator;
using std::mt19937;
using std::uniform_real_distribution;
typedef mt19937 Engine;
typedef uniform_real_distribution<float> Distribution;
typedef variate_generator< Engine, Distribution > Generator;
Generator r( Engine((DWORD)time(NULL)), Distribution(0.0f, 1.0f) );
// from now, calling float rnd = r() gave me a random number between 0.0f and 1.0f in rnd.
我现在已将此代码放入 VS2012 解决方案中,我收到的错误消息是它std::variate_generator
不是std
.
已std::variate_generator
移动或被移除?