diff --git a/include/boost/random/poisson_distribution.hpp b/include/boost/random/poisson_distribution.hpp index 820d8d1..dd20001 100644 --- a/include/boost/random/poisson_distribution.hpp +++ b/include/boost/random/poisson_distribution.hpp @@ -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::is_integer); - BOOST_STATIC_ASSERT(!std::numeric_limits::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::is_integer); + BOOST_STATIC_ASSERT(!std::numeric_limits::is_integer); +#endif + assert(mean > RealType(0)); init(); } diff --git a/include/boost/random/uniform_smallint.hpp b/include/boost/random/uniform_smallint.hpp index 21e5e8c..fb72e84 100644 --- a/include/boost/random/uniform_smallint.hpp +++ b/include/boost/random/uniform_smallint.hpp @@ -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::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::is_integer); +#endif + } result_type min() const { return _min; } result_type max() const { return _max; }