You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
508 B

#pragma once
#include "../common.h"
#include "../rng.h"
#include "../mem.h"
namespace rng
{
struct crand final : public Random
{
crand();
crand(u64 seed);
inline ~crand(){}
inline i64 next_i64() override { return _sample_raw(); }
u64 next_u64() override;
protected:
f64 _sample() override;
private:
struct _opaque;
struct _deleter { static void delete_object(_opaque** st); };
mem::aligned_ptr<_opaque, _deleter> _state;
explicit crand(_opaque* raw);
i64 _sample_raw();
};
}