hackingcpp / comments

Comments regarding hackingcpp.com
0 stars 0 forks source link

cpp/recipe/random_reproducibility #22

Open tocic opened 1 year ago

tocic commented 1 year ago

(Non-)Reproducible Random Number Sequences | hacking C++

How to obtain reproducible / unpredictable random number sequences?

https://hackingcpp.com/cpp/recipe/random_reproducibility.html

tocic commented 1 year ago

Hello, thanks for the great resource.

Please consider changing the Dice constructor in the last example from

explicit
Dice(seed_type seed = 0);

to

Dice();
explicit Dice(seed_type seed);

to unblock copy-list-initialization. See P0935 for details.

hackingcpp commented 1 year ago

@tocic good point! I totally forgot about this, despite having been bitten by this issues a couple of times in the past. I updated the example accordingly.