Does the standard require the output of seed_seq to be the same for different implementations of the stl? In other words, is the following guaranteed to produce the same output on different standard compliant platforms, or not?
std::seed_seq sseq = { 1701, 1729, 1791 };
std::array<unsigned int, 5> seq;
sseq.generate(seq.begin(), seq.end());
for (unsigned x : seq)
std::cout << x << " " << std::endl;
Yes. The algorithm is defined in 23.54.7.1 [rand.util.seedseq]
posting this as an image as it loses formatting as text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With