import mir.random;
import std.range.primitives: isRandomAccessRange;
// SplitMix64 should be both a Mir-style saturated
// random engine and a Phobos-style uniform RNG
// and random access range.
static assert(isPhobosUniformRNG!SplitMix64);
static assert(isRandomAccessRange!SplitMix64);
static assert(isSaturatedRandomEngine!SplitMix64);
SplitMix64 a = SplitMix64(1);
immutable ulong x = a.front;
SplitMix64 b = a.save;
assert (x == a.front);
assert (x == b.front);
assert (x == a[0]);
immutable ulong y = a[1];
assert(x == a());
assert(x == b());
assert(a.front == y);
Canonical fixed increment (non-splittable) SplitMix64 engine.
64 bits of state, period of 2 ^^ 64.