[PATCH] D41316: [libcxx] Allow random_device to be built optionally

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 2 15:36:13 PDT 2018


efriedma added a comment.

Yes, the standard says you're allowed to throw an exception from the random_device constructor, or use a PRNG with an arbitrary seed, or even just return zeros from operator(). But none of those behaviors are actually useful; the code will compile, but you won't get the expected randomness.  So I prefer this solution, even if it isn't strictly standard-compliant.

(I'll post an updated version with the tests fixed soon.)


https://reviews.llvm.org/D41316





More information about the cfe-commits mailing list