5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TESTING_ARRAY_DISTRIBUTION_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TESTING_ARRAY_DISTRIBUTION_HPP_
11#include "arene/base/stdlib_choice/cstddef.hpp"
12#include "arene/base/stdlib_choice/enable_if.hpp"
13#include "arene/base/stdlib_choice/is_default_constructible.hpp"
14#include "arene/base/stdlib_choice/is_move_assignable.hpp"
15#include "arene/base/stdlib_choice/is_move_constructible.hpp"
16#include "arene/base/stdlib_choice/reference_wrapper.hpp"
28template <
class Distribution, std::
size_t N>
36 "array_distribution builds its result in place, so the element type must be default constructible"
40 template <class T = Distribution, constraints<std::enable_if_t<std::is_default_constructible<T>::value>> =
nullptr>
62 arene::base::generate(
65 return dist_(generator.get());
A fixed-size array of T objects.
Definition array.hpp:77
A sum type which can hold either a value or an error. Similar to std::expected.
Definition result.hpp:104
arene::base::array< typename Distribution::result_type, N > result_type
The value type produced by this adaptor.
Definition array_distribution.hpp:32
auto operator()(PRNG &prng) const noexcept(arene::base::is_nothrow_invocable_v< Distribution const &, PRNG & > &&std::is_nothrow_move_assignable< typename Distribution::result_type >::value &&std::is_nothrow_default_constructible< typename Distribution::result_type >::value &&std::is_nothrow_move_constructible< result_type >::value) -> result_type
Draw an array whose every element comes from an independent draw of the wrapped distribution.
Definition array_distribution.hpp:54
constexpr array_distribution() noexcept
Default construct adapted distribution.
Definition array_distribution.hpp:41
constexpr array_distribution(Distribution dist) noexcept
Construct the adaptor wrapping the given distribution.
Definition array_distribution.hpp:46
static constexpr value_type value
Definition integral_constant.hpp:34
wraps a reference in a copyable and assignable object
Definition reference_wrapper.hpp:178
Definition customization.hpp:31
Definition accumulate.hpp:37
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
Definition accumulate.hpp:36