【发布时间】:2013-01-21 15:17:29
【问题描述】:
对于使用std::random_shuffle 的代码,我需要设置一个随机种子,以便在每次程序运行时产生的伪随机序列有所不同。
code example here 拨打电话
srand ( unsigned ( time (NULL) ) );
需要
#include <ctime>
#include <cstdlib>
我想知道:由于 C++11 包括对伪随机数生成的重大更新,这仍然是最新的吗?我应该使用什么来为std::random_shuffle 设置随机种子?
【问题讨论】: