mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
Fix unpredictableSeed so that rndstuff can be used in @safe code
Allows: 1) canFind's tests to be @safe 2) allows the remainder of find's tests to be @safe
This commit is contained in:
parent
3200b08644
commit
f70e1e41e4
2 changed files with 7 additions and 7 deletions
|
@ -1114,7 +1114,7 @@ auto n = rnd.front;
|
|||
----
|
||||
*/
|
||||
|
||||
@property uint unpredictableSeed()
|
||||
@property uint unpredictableSeed() @trusted
|
||||
{
|
||||
static bool seeded;
|
||||
static MinstdRand0 rand;
|
||||
|
@ -1128,7 +1128,7 @@ auto n = rnd.front;
|
|||
return cast(uint) (TickDuration.currSystemTick.length ^ rand.front);
|
||||
}
|
||||
|
||||
unittest
|
||||
@safe unittest
|
||||
{
|
||||
// not much to test here
|
||||
auto a = unpredictableSeed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue