1
0
Fork 0
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:
bolero-MURAKAMI 2013-04-11 15:50:14 +09:00
parent 9d938bd747
commit a5b7eda260
5 changed files with 205 additions and 207 deletions

View file

@ -21,12 +21,10 @@ 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),

View file

@ -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