mirror of
https://github.com/boostorg/random.git
synced 2026-01-23 17:52:18 +00:00
move static assertions on std::numeric_limits<> from class to constructor
scope to suit MSVC [SVN r19000]
This commit is contained in:
@@ -34,14 +34,15 @@ public:
|
||||
typedef RealType input_type;
|
||||
typedef IntType result_type;
|
||||
|
||||
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
|
||||
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
|
||||
#endif
|
||||
|
||||
explicit poisson_distribution(const RealType& mean = RealType(1))
|
||||
: _mean(mean)
|
||||
{
|
||||
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
|
||||
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
|
||||
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
|
||||
#endif
|
||||
|
||||
assert(mean > RealType(0));
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -165,13 +165,14 @@ public:
|
||||
typedef IntType input_type;
|
||||
typedef IntType result_type;
|
||||
|
||||
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
|
||||
#endif
|
||||
|
||||
explicit uniform_smallint(IntType min = 0, IntType max = 9)
|
||||
: _min(min), _max(max)
|
||||
{ }
|
||||
{
|
||||
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
|
||||
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
|
||||
#endif
|
||||
}
|
||||
|
||||
result_type min() const { return _min; }
|
||||
result_type max() const { return _max; }
|
||||
|
||||
Reference in New Issue
Block a user