Hegel 0.3.5
Property-based testing for C++
Loading...
Searching...
No Matches
hegel::generators::HegelRandom Class Reference

A random engine that integrates with Hypothesis via Hegel. More...

#include <random.h>

Detailed Description

A random engine that integrates with Hypothesis via Hegel.

Satisfies the C++ UniformRandomBitGenerator named requirement, so it can be used with any <random> distribution.

auto rng = tc.draw(gs::randoms());
std::uniform_real_distribution<double> dist(0.0, 10.0);
double uniform_value = dist(rng);
// Using true random
auto rng = tc.draw(gs::randoms({ .use_true_random = true }));
std::lognormal_distribution<double> dist(0.0, 10.0);
double uniform_value = dist(rng);

The documentation for this class was generated from the following file: