workaround for Clang3.2 (geometric_distribution)

This commit is contained in:
bolero-MURAKAMI 2012-11-12 14:07:55 +09:00
parent bf937bc508
commit 59a6e6f613
2 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/algorithm/max.hpp>
#include <sprout/math/abs.hpp>
#include <sprout/math/fabs.hpp>
#include <sprout/type_traits/arithmetic_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp>
@ -22,8 +22,8 @@ namespace sprout {
inline SPROUT_CONSTEXPR bool
equal_to_impl(FloatType x, FloatType y) {
return x == y
|| sprout::abs(x - y)
<= std::numeric_limits<FloatType>::epsilon() * sprout::math::detail::max3(std::abs(x), std::abs(y), FloatType(1.0))
|| sprout::fabs(x - y)
<= std::numeric_limits<FloatType>::epsilon() * sprout::math::detail::max3(sprout::fabs(x), sprout::fabs(y), FloatType(1))
;
}

View file

@ -69,7 +69,7 @@ namespace sprout {
sprout::random::random_result<Engine, uniform_01>()
;
}
template<int D = 0, typename Engine, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(D)>
template<int D = 2, typename Engine, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(D)>
SPROUT_CONSTEXPR sprout::random::random_result<Engine, uniform_01>
generate(Engine const& eng, sprout::random::random_result<Engine> const& rnd) const {
typedef typename Engine::result_type base_result;
@ -85,7 +85,7 @@ namespace sprout {
)
);
}
template<int D = 0, typename Engine, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(D)>
template<int D = 2, typename Engine, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(D)>
SPROUT_CONSTEXPR sprout::random::random_result<Engine, uniform_01>
generate(Engine const& eng, sprout::random::random_result<Engine> const& rnd) const {
return throw std::runtime_error(SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_EXCEEDED_MESSAGE),