On 6/17/2020 1:48 PM, John Maddock via Boost wrote:
On 17/06/2020 15:53, Paul A Bristow via Boost wrote:
I have wanted to use boost::random::random_device; as a seeder for my generator.
#include
// For boost::random::random_device; seeder But using this requires that I link to a library file // LINK : fatal error LNK1104: cannot open file 'libboost_random-vc142-mt-gd-x64-1_73.lib'
So I have instead used C++ std random device successfully
using std::random_device; random_device seeder; // Use seeder to get a different set of values each time. static boost::random::mt19937 gen(seeder()); // uint32_t
But is there any way I can stick to the Boost version (I imagine that it might prove more portable? Or is this a delusion?)
What do you mean by portable? random_device is inherently non-portable because it's.... random ;)
In many ways this is something that the std:: version does best as the system implementer knows best how to implement on their OS. Or you could just link to Boost.Random of course which would work nearly everywhere too I'm sure.
Sorry for breaking in but I have a Random PR for the Embarcadero C++ clang-based compilers which is a no-brainer to merge, if anyone has access to merge boost.random. Also for Boost.regex I have an Embarcadero C++ clang-baed PR waiting to merge.