1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

add random::result, random::next

This commit is contained in:
bolero-MURAKAMI 2014-01-16 18:59:25 +09:00
parent 3879666b02
commit 769e18178a
23 changed files with 191 additions and 136 deletions

View file

@ -16,7 +16,7 @@
#include <sprout/random/default_random_engine.hpp>
#include <sprout/random/uniform_int_distribution.hpp>
#include <sprout/random/variate_generator.hpp>
#include <sprout/generator/functions.hpp>
#include <sprout/random/result.hpp>
namespace sprout {
namespace uuids {
@ -59,14 +59,14 @@ namespace sprout {
sizeof...(Args) == 3,
result_type
>::type random_to_uuid(Random const& rnd, Args... args) const {
return random_to_uuid_1(args..., sprout::generators::generated_value(rnd));
return random_to_uuid_1(args..., sprout::random::result(rnd));
}
template<typename Random, typename... Args>
SPROUT_CONSTEXPR typename std::enable_if<
sizeof...(Args) != 3,
result_type
>::type random_to_uuid(Random const& rnd, Args... args) const {
return random_to_uuid(sprout::generators::next_generator(rnd)(), args..., sprout::generators::generated_value(rnd));
return random_to_uuid(sprout::random::next(rnd)(), args..., sprout::random::result(rnd));
}
public:
SPROUT_CONSTEXPR basic_random_generator()