[cfe-dev] [libc++] Porting libc++ to embedded targets/compilers

Ben Craig via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 13 06:38:33 PDT 2017


>- The implementation of std::random_device does not support utilizing a random number engine in the absence of implementation-specific non-deterministic RNGs
>Two third-party library solutions, arc4 and Sodium, and two /platform-specific solutions, Unix-like /dev/random and Microsoft srand_s are supported.
>Could a fallback macro be used to implement random_device via another engine found in the random header? I think std::mt19937 is the simplest random engine that supports the full range of values of unsigned int.

The intent of the standard and the expectation of users is that std::random_device provide true random (and not pseudo-random) numbers.  In my opinion, it is better to omit std::random_device than it would be to make it provide pseudo-random numbers.  If a user only needs pseudo-random numbers, then they can directly use the pseudo-random facilities.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170913/a8348a99/attachment.html>


More information about the cfe-dev mailing list