1#ifndef HALCHECK_GEN_ELEMENT_HPP
2#define HALCHECK_GEN_ELEMENT_HPP
10#include <halcheck/gen/discard.hpp>
11#include <halcheck/gen/range.hpp>
12#include <halcheck/gen/sample.hpp>
13#include <halcheck/gen/shrink.hpp>
14#include <halcheck/lib/atom.hpp>
15#include <halcheck/lib/iterator.hpp>
16#include <halcheck/lib/pp.hpp>
17#include <halcheck/lib/type_traits.hpp>
25namespace halcheck {
namespace gen {
53 template<typename T, HALCHECK_REQUIRE(lib::is_input_range<T>()),
HALCHECK_REQUIRE(lib::is_sized_range<T>())>
56 auto it = lib::begin(
range);
62 template<typename T, HALCHECK_REQUIRE(lib::is_forward_range<T>()),
HALCHECK_REQUIRE(!lib::is_sized_range<T>())>
74 return std::move((*
this)(
id,
range));
92 template<
typename... Args>
HALCHECK_INLINE_CONSTEXPR struct halcheck::gen::@6 element_of
Generates a random element of a range.
HALCHECK_INLINE_CONSTEXPR struct halcheck::gen::@7 element
Generates a random value from a fixed list of elements.
static const range_t range
Generates a random value in an closed-open interval.
Definition range.hpp:93
lib::variant< lib::symbol, lib::number > atom
An atom is either a symbol or a number.
Definition atom.hpp:194
lib::iter_value_t< lib::iterator_t< R > > range_value_t
The type of element contained in a range.
Definition range.hpp:332
HALCHECK_INLINE_CONSTEXPR struct halcheck::lib::@25 size
Obtains the size of a range.
lib::iter_reference_t< lib::iterator_t< R > > range_reference_t
The type returned by operator* for a range type's iterators.
Definition range.hpp:340
#define HALCHECK_INLINE_CONSTEXPR
A backwards-compatible substitute for inline constexpr.
Definition pp.hpp:70
typename std::remove_reference< T >::type remove_reference_t
An implementation of std::remove_reference_t.
Definition type_traits.hpp:175
typename std::common_type< Args... >::type common_type_t
An implementation of std::common_type_t.
Definition type_traits.hpp:133
#define HALCHECK_REQUIRE(...)
Expands to a template argument that is only valid if the given argument evaluates to true.
Definition type_traits.hpp:24
lib::variant< std::integral_constant< std::size_t, Ints >... > index(lib::atom id, lib::index_sequence< Ints... >={})
Generates a random std::integral_constant from the given set of indices.
Definition variant.hpp:39