Why do I get the same sequence for every run with std::random_device with mingw gcc4.8.1?

后端 未结 5 1525
野性不改
野性不改 2020-11-22 02:46

I use the following code to test the C++ library.

Why do I get the exact same sequence for every run of the compiled executable? Is

5条回答
  •  名媛妹妹
    2020-11-22 03:25

    I got a confirmed answer from STL from MSFT:

    Unlike VC, GCC hasn't implemented random_device nondeterministically on Windows. Boost has, so you can use Boost.Random.

提交回复
热议问题