31 template<
class DeriveT>
33 : m_d(
std::make_unique<Model<DeriveT>>(
std::move(obj)))
57 template<
class RangeT>
59 using ValueT = std::decay_t<decltype(* (std::declval<RangeT>().
begin()))>;
60 RangeT range(size, ValueT());
72 template<
class RangeT>
74 std::generate(range.
begin(), range.
end(), [
this] { return (*this)(); });
81 virtual ~Concept() =
default;
85 template<
class DeriveT>
86 struct Model :
public Concept
88 Model(DeriveT obj) : instance(
std::move(obj)) {}
89 ~Model()
override =
default;
96 std::unique_ptr<Concept> m_d;
110 std::unique_ptr<std::random_device> m_d;
A movable wrapper around std::random_device.
Definition: random-generator.hpp:103
auto operator()()
Definition: random-generator.hpp:107
RandomDeviceGenerator()
Definition: random-generator.hpp:105
Definition: random-generator.hpp:16
unsigned int DataT
Definition: random-generator.hpp:18
RangeT fillRange(RangeT range)
Fill the given range.
Definition: random-generator.hpp:73
RandomInterface(DeriveT obj)
Construct a RandomInterface using an implementation.
Definition: random-generator.hpp:32
RangeT generateRange(std::size_t size)
Generate a range containing size random elements.
Definition: random-generator.hpp:58
DataT operator()()
Generate a random number of type DataT.
Definition: random-generator.hpp:41
A RangeT is an ordered collection that can be iterated through.
Definition: range-t.hpp:21
auto end() const
The past-end iterator of this range.
auto begin() const
The beginning iterator of this range.
Definition: location.hpp:10
Definition: clientutil.hpp:217