Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the algorithm behind std::seed_seq defined?

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;
like image 430
Peter Avatar asked Sep 25 '26 09:09

Peter


1 Answers

Yes. The algorithm is defined in 23.54.7.1 [rand.util.seedseq]

posting this as an image as it loses formatting as text

enter image description here

like image 173
NathanOliver Avatar answered Sep 26 '26 23:09

NathanOliver