So, I've come across some answers and comments about random_device
either being bugged or it purposefully using a deterministic method as a fallback when a non-deterministic method can't be used on the implementation.
As a matter of fact, I'm on Windows using GCC and I can't use random_device
because of that problem (every created instance returns the same number). I know you could use time()
but this isn't ideal either as seeds are identical when created in the same second.
What are portable alternatives that can be used for seeding PRNG?
Aucun commentaire:
Enregistrer un commentaire