英文文档 std::mersenne_twister_engine - cppreference.com https://cplusplus.com/reference/random/mt19937/ 什么是mt19937 std::mt19937是C++标准库中的一个伪随机数生成器类,它实现了梅森旋转算法(Mersenne Twister)。mt19937类是一个随机数引擎,可以生成高质量的伪随机数序列。 A Mersenne Twister pseudo-...
cppreference Maybe using std::unique_ptr can help us to delay the creation of PRNG and avoid memory leaks. Because at the end of the thread, the destructor of std::unique_ptr will be called, and the memory corresponding to the PRNG will be released. If you think this suggestion is ...