mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2024-11-12 21:09:01 +00:00
support Generator Requirement: generator_iterator, random_redult
This commit is contained in:
parent
9f11b2481d
commit
e0629a21ce
2 changed files with 15 additions and 0 deletions
|
@ -72,6 +72,9 @@ namespace sprout {
|
|||
SPROUT_CONSTEXPR generator_iterator next_generator() const {
|
||||
return (*this)();
|
||||
}
|
||||
SPROUT_CONSTEXPR operator reference() const {
|
||||
return generated_value();
|
||||
}
|
||||
SPROUT_CXX14_CONSTEXPR void swap(generator_iterator& other)
|
||||
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(gen_, other.gen_)))
|
||||
{
|
||||
|
|
|
@ -114,6 +114,12 @@ namespace sprout {
|
|||
SPROUT_CONSTEXPR distribution_type const& distribution() const SPROUT_NOEXCEPT {
|
||||
return distribution_;
|
||||
}
|
||||
SPROUT_CXX14_CONSTEXPR operator result_type&() SPROUT_NOEXCEPT {
|
||||
return generated_value();
|
||||
}
|
||||
SPROUT_CONSTEXPR operator result_type const&() const SPROUT_NOEXCEPT {
|
||||
return generated_value();
|
||||
}
|
||||
SPROUT_CONSTEXPR result_type min() const SPROUT_NOEXCEPT {
|
||||
return distribution_.min();
|
||||
}
|
||||
|
@ -233,6 +239,12 @@ namespace sprout {
|
|||
SPROUT_CONSTEXPR random_result const& next_generator() const SPROUT_NOEXCEPT {
|
||||
return *this;
|
||||
}
|
||||
SPROUT_CXX14_CONSTEXPR operator result_type&() SPROUT_NOEXCEPT {
|
||||
return generated_value();
|
||||
}
|
||||
SPROUT_CONSTEXPR operator result_type const&() const SPROUT_NOEXCEPT {
|
||||
return generated_value();
|
||||
}
|
||||
SPROUT_CONSTEXPR result_type min() const SPROUT_NOEXCEPT {
|
||||
return engine_.min();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue