8 #if defined(ZEROERR_ENABLE_PFR) && (ZEROERR_CXX_STANDARD >= 14)
16 template <
typename T,
typename... Inner>
20 using CorpusType = std::tuple<
typename Inner::CorpusType...>;
23 template <
unsigned... I>
28 template <
unsigned... I>
30 return ValueType{std::get<I>(inner_domains).GetValue(std::get<I>(v))...};
33 template <
unsigned... I>
35 return CorpusType{std::get<I>(inner_domains).FromValue(std::get<I>(v))...};
38 std::tuple<Inner...> inner_domains;
41 AggregateOf(Inner&&... inner) : inner_domains(std::make_tuple(std::move(inner)...)) {}
59 template <
typename D,
typename H>
66 unsigned index = rng.
bounded(
sizeof...(Inner));
73 #ifdef ZEROERR_ENABLE_PFR
75 template <
typename T,
typename... Inner>
76 AggregateOfImpl<T, Inner...> StructOf(Inner&&... inner) {
77 return AggregateOfImpl<T, Inner...>(std::move(inner)...);
82 template <
typename... Inner>
84 return AggregateOf<std::tuple<
typename Inner::ValueType...>, Inner...>(std::move(inner)...);
87 template <
typename K,
typename V>
Definition: aggregate_of.h:17
void Mutate(Rng &rng, CorpusType &v, bool only_shrink) const override
Definition: aggregate_of.h:65
T ValueType
Definition: aggregate_of.h:19
CorpusType GetRandomCorpus(Rng &rng) const override
Definition: aggregate_of.h:43
std::tuple< typename Inner::CorpusType... > CorpusType
Definition: aggregate_of.h:20
CorpusType FromValue(const ValueType &v) const override
Definition: aggregate_of.h:51
AggregateOf(Inner &&... inner)
Definition: aggregate_of.h:41
ValueType GetValue(const CorpusType &v) const override
Definition: aggregate_of.h:47
Domain class for generating random values of a specific type.
Definition: domain.h:22
virtual CorpusType GetRandomCorpus(Rng &rng) const =0
uint32_t bounded(uint32_t range) noexcept
Definition: rng.h:126
#define ZEROERR_SUPPRESS_COMMON_WARNINGS_POP
Definition: config.h:265
#define ZEROERR_SUPPRESS_COMMON_WARNINGS_PUSH
Definition: config.h:218
void visit2_at(const std::tuple< Ts... > &tup1, const std::tuple< T2s... > &tup2, size_t idx, F &&fun)
Definition: typetraits.h:220
Definition: benchmark.cpp:17
AggregateOf< std::pair< typename K::ValueType, typename V::ValueType >, K, V > PairOf(K &&k, V &&v)
Definition: aggregate_of.h:88
AggregateOf< std::tuple< typename Inner::ValueType... >, Inner... > TupleOf(Inner &&... inner)
Definition: aggregate_of.h:83
Definition: aggregate_of.h:55
Rng & rng
Definition: aggregate_of.h:56
bool only_shrink
Definition: aggregate_of.h:57
void operator()(const D &domain, H &value)
Definition: aggregate_of.h:60
Definition: typetraits.h:58
Definition: typetraits.h:55