mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2024-11-12 21:09:01 +00:00
fix libs/random/example/array.cpp
This commit is contained in:
parent
9d938bd747
commit
a5b7eda260
5 changed files with 205 additions and 207 deletions
|
@ -21,12 +21,10 @@ main(){
|
||||||
static constexpr sprout::default_random_engine engine;
|
static constexpr sprout::default_random_engine engine;
|
||||||
static constexpr sprout::uniform_smallint<int> dist(1, 6);
|
static constexpr sprout::uniform_smallint<int> dist(1, 6);
|
||||||
|
|
||||||
static constexpr sprout::array<int, 10> result = sprout::generate(
|
static constexpr auto result = sprout::generate
|
||||||
// Result type
|
<sprout::array<int, 10> /* Result type */>
|
||||||
sprout::array<int, 10>{},
|
(sprout::random::combine(engine, dist) /*Random generator*/)
|
||||||
// Random generator
|
;
|
||||||
sprout::random::combine(engine, dist)
|
|
||||||
);
|
|
||||||
|
|
||||||
static_assert(
|
static_assert(
|
||||||
result == sprout::make_array<int>(1, 1, 5, 2, 4, 2, 6, 2, 5, 1),
|
result == sprout::make_array<int>(1, 1, 5, 2, 4, 2, 6, 2, 5, 1),
|
||||||
|
|
|
@ -85,7 +85,7 @@ namespace sprout {
|
||||||
template<typename Container, typename Generator>
|
template<typename Container, typename Generator>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Container>::type
|
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Container>::type
|
||||||
generate(Generator const& gen) {
|
generate(Generator const& gen) {
|
||||||
return sprout::fixed::generate(sprout::pit<Container>());
|
return sprout::fixed::generate(sprout::pit<Container>(), gen);
|
||||||
}
|
}
|
||||||
} // namespace fixed
|
} // namespace fixed
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue