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

[破壊的変更] uniform_int_distribution::max() 9 -> numeric_limits::max()

add reset function
This commit is contained in:
bolero-MURAKAMI 2013-11-09 18:13:26 +09:00
parent b60a7aca9c
commit 81603007f6
8 changed files with 19 additions and 8 deletions

View file

@ -12,6 +12,7 @@
#include <istream>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/limits.hpp>
#include <sprout/random/detail/signed_unsigned_tools.hpp>
#include <sprout/random/random_result.hpp>
#include <sprout/random/uniform_01.hpp>
@ -40,9 +41,9 @@ namespace sprout {
public:
SPROUT_CONSTEXPR param_type()
: min_(0)
, max_(9)
, max_(sprout::numeric_limits<IntType>::max())
{}
explicit SPROUT_CONSTEXPR param_type(IntType min_arg, IntType max_arg = 9)
explicit SPROUT_CONSTEXPR param_type(IntType min_arg, IntType max_arg = sprout::numeric_limits<IntType>::max())
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)
{}
@ -230,9 +231,9 @@ namespace sprout {
public:
SPROUT_CONSTEXPR uniform_smallint() SPROUT_NOEXCEPT
: min_(0)
, max_(9)
, max_(sprout::numeric_limits<IntType>::max())
{}
explicit SPROUT_CONSTEXPR uniform_smallint(IntType min_arg, IntType max_arg = 9)
explicit SPROUT_CONSTEXPR uniform_smallint(IntType min_arg, IntType max_arg = sprout::numeric_limits<IntType>::max())
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)
{}
@ -252,6 +253,7 @@ namespace sprout {
SPROUT_CONSTEXPR result_type max() const SPROUT_NOEXCEPT {
return max_;
}
SPROUT_CXX14_CONSTEXPR void reset() SPROUT_NOEXCEPT {}
SPROUT_CONSTEXPR param_type param() const SPROUT_NOEXCEPT {
return param_type(min_, max_);
}