From c0589d9925276760fd49ec3bbb8347717ef1f4b1 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Wed, 7 Aug 2013 16:49:27 +0900 Subject: [PATCH] fix type: SPROUT_UNIQUE_SEED --- sprout/random/unique_seed.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sprout/random/unique_seed.hpp b/sprout/random/unique_seed.hpp index 417f1f2e..ad8be625 100644 --- a/sprout/random/unique_seed.hpp +++ b/sprout/random/unique_seed.hpp @@ -2,6 +2,7 @@ #define SPROUT_RANDOM_UNIQUE_SEED_HPP #include +#include #include #include #include @@ -13,34 +14,34 @@ namespace sprout { // make_seed // template - SPROUT_CONSTEXPR std::size_t + SPROUT_CONSTEXPR std::uint_least32_t make_seed(T const& v) { - return sprout::to_hash(v); + return static_cast(sprout::to_hash(v)); } namespace detail { template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) + 1 == N, - sprout::array + sprout::array >::type make_seed_seq_impl(T const&, std::size_t seed, Args const&... args) { - return sprout::array{{args..., seed}}; + return sprout::array{{args..., static_cast(seed)}}; } template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) + 1 != N, - sprout::array + sprout::array >::type make_seed_seq_impl(T const& v, std::size_t seed, Args const&... args) { - return sprout::detail::make_seed_seq_impl(v, sprout::hash_combine(seed, v), args..., seed); + return sprout::detail::make_seed_seq_impl(v, sprout::hash_combine(seed, v), args..., static_cast(seed)); } } // namespace detail // // make_seed_seq // template - SPROUT_CONSTEXPR sprout::array + SPROUT_CONSTEXPR sprout::array make_seed_seq(T const& v) { return sprout::detail::make_seed_seq_impl(v, sprout::to_hash(v)); }