#pragma once #include #include #include namespace engine::random { class Random { private: std::shared_ptr impl_; std::shared_ptr tape_{nullptr}; public: Random(); Random(Random const & other, Tape & with_tape); Random(Random const & other, std::shared_ptr with_tape); template Random(P const & p) : impl_(std::make_shared

(p)) {} template Random(std::shared_ptr

const & p) : impl_(p) {} template Rand operator()(Distribution const & dist) const; /** * Create a scope in which all calls to the generator functions will record * their results into a tape. Expects that there is no tape currently set. * @param tape The tape to write to * @return A scope object that stops recording once it is descructed */ scope_exit record(std::shared_ptr tape); std::shared_ptr tape() const { return tape_; } }; }