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,16 +21,14 @@ main(){
|
|||
static constexpr sprout::default_random_engine engine;
|
||||
static constexpr sprout::uniform_smallint<int> dist(1, 6);
|
||||
|
||||
static constexpr sprout::array<int, 10> result = sprout::generate(
|
||||
// Result type
|
||||
sprout::array<int, 10>{},
|
||||
// Random generator
|
||||
sprout::random::combine(engine, dist)
|
||||
);
|
||||
static constexpr auto result = sprout::generate
|
||||
<sprout::array<int, 10> /* Result type */>
|
||||
(sprout::random::combine(engine, dist) /*Random generator*/)
|
||||
;
|
||||
|
||||
static_assert(
|
||||
result == sprout::make_array<int>(1, 1, 5, 2, 4, 2, 6, 2, 5, 1),
|
||||
"");
|
||||
"");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace sprout {
|
|||
template<typename Container, typename Generator>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Container>::type
|
||||
generate(Generator const& gen) {
|
||||
return sprout::fixed::generate(sprout::pit<Container>());
|
||||
return sprout::fixed::generate(sprout::pit<Container>(), gen);
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
|
|
Loading…
Reference in a new issue