3 ms·
std::seed_seq and the SeedSeq concept look incredibly broken, also it looks way over-engineered. Why can't a random generator engine just get a Calleable as a c
by steerablesafe 6y ago
std::seed_seq and the SeedSeq concept look incredibly broken, also it looks way over-engineered. Why can't a random generator engine just get a Calleable as a constructor argument and call it as many times as it needs to seed itself? SeedSeq tries to be way more than it needs to be while failing its basic requirement.
- quietbritishjim 6y agoYes indeed. In Boost.Random (which the standard library random was based on), you can do exactly that: boost::mt19937 generator(boost::random_device()); You can also pass an appropriate length container (as two iterators) which are directly used as the seed without any intermediate object.